Apache

ID #117

How do I turn off webservers' gzip compression?

Applies to: Grid System

Certain web browsers have difficulty with gzip compression often used by webservers.  To turn gzip commpression off, create a file called .htaccess in the directory where you want to turn off gzip compression and put these lines in it:

<IfModule mod_env.c>

SetEnv no-gzip dont-vary

</IfModule>

That will turn off the compression for all things served from that directory and its subdirectories.

If you want to turn off compression on your whole site, you could put that .htaccess file in your home directory. We recommend against turning off gzip compression unnecessarily;  since the compression makes files smaller, it speeds site loading times and saves you bandwidth usage.

You may also disable compression for certain types of files by replacing the SetEnv from above with:

SetEnvIfNoCase Request_URI "\.php$" no-gzip dont-vary

This line would stop gzip for all files ending in .php.  You can use as many of these lines as you like to disable gzip for many file types.

You can learn more about this subject in the Apache Documentation.


Last update: 2011-07-11 17:12
Author: FAQ Admin
Revision: 1.7

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 3.2 (5 Votes)

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ

Comment of Anonymous:
This also worked to help clear up a problem with a PHP script not properly flushing data to the browser with the flush() function.
Added at: 2004-02-25 08:07