[thelist] mod_gzip

MarsHall evolt at marsorange.com
Mon Nov 18 10:29:01 CST 2002


Peter...

When mod_gzip is installed and enabled, the HTTP server will send the
content encoded with gzip compression ONLY IF the requesting user-agent
has gzip listed in it's "Accept-Encoding" header. Otherwise, the
connection will proceed without compression. Most modern browsers do
support gzip.

AFAIK, the module works fine with PHP. It seems like output buffering
in PHP would be a good practice if your expecting the pages to be
gzipped on-the-fly...

You need to understand how to install new Apache modules, if mod_gzip
is not already installed, and edit the httpd.conf file in order to make
it work (see doc links below). If you only have user-level access to a
virtual server, this may be a problem... modules must be installed by
root.

The drawbacks are:

--- processing overhead --- which is minor in most cases and can be
completely circumvented by pre-gziping files, so that the server just
sends the compressed file instead of compressing on-the-fly. This
technique would only work for static files [i.e. not PHP], though.

--- proxy/cache issues --- Apparently, some proxies and caches (that
read actual HTML content such as meta-tags) do not play well with
gzip-compressed HTTP content. I am left wondering if those devices
would munge the page, drop the connection or throw an error?

For unofficial documentation, see:
	http://www.schroepl.net/projekte/mod_gzip/
	http://www.darkmere.gen.nz/2000/1105.html

Mars :)




More information about the thelist mailing list