mod_gzip: How to correct various issues

source: webhostingtalk.com
When using mod_gzip you may find various quirks and problems with it because it is currently unmaintained and has known issues. Some of these can be worked around using certain configuration options to make mod_gzip usable in a production environment.

This configuration has been used/tested on production Linux/FreeBSD boxes using mod_gzip with Apache 1.3.x. Your mileage with this configuration may vary.

Note: When using cPanel make sure to remove the existing mod_gzip configuration (or comment it out) before using this.

Quote:
<IfModule mod_gzip.c>
mod_gzip_on Yes
<Files ~ "\.(gif|jpe?g|png|bmp)$">
mod_gzip_on no
</Files>
mod_gzip_dechunk Yes
mod_gzip_send_vary Yes
mod_gzip_keep_workfiles No
mod_gzip_temp_dir /tmp
mod_gzip_command_version '/mod_gzip_status'
mod_gzip_minimum_file_size 1002
mod_gzip_maximum_file_size 0
mod_gzip_maximum_inmem_size 100000
mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.html$
mod_gzip_item_include mime ^text/.*$
mod_gzip_item_include mime ^application/postscript$
mod_gzip_item_include mime ^application/ms.*$
mod_gzip_item_include mime ^application/vnd.*$
mod_gzip_item_exclude mime ^image/.*$
mod_gzip_item_exclude mime ^application/x-javascript$
mod_gzip_item_exclude mime ^application/pdf$
mod_gzip_item_include mime ^httpd/unix-directory$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.phps$
mod_gzip_item_include file \.pl$
mod_gzip_item_include file \.cgi$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^application/x-httpd-php.*
mod_gzip_item_exclude file \.css$
mod_gzip_item_exclude file \.js$
mod_gzip_item_exclude file \.wml$
</IfModule>

Tags: Linux