Output compression reduces the network load and can improve the overall
throughput of the webserver.
throughput of the webserver. All major http-clients support compression by
announcing it in the Accept-Encoding header. This is used to negotiate the
most suitable compression method. We support deflate, gzip and bzip2.
Only static content is supported up to now.
deflate (RFC1950, RFC1951) and gzip (RFC1952) depend on zlib while bzip2
depends on libbzip2. bzip2 is only supported by lynx and some other console
The server negotiates automaticly which compression method is used.
Supported are gzip, deflate, bzip.
We currently limit to compression support to static files.
mod_compress can store compressed files on disk to optimize the compression
on a second request away. As soon as compress.cache-dir is set the files are
(You will need to create the cache directory if it doesn't already exist. The web server will not do this for you. The directory will also need the proper ownership. For Debian/Ubuntu the user and group ids should both be www-data.)
The names of the cache files are made of the filename, the compression method
and the etag associated to the file.
Cleaning the cache is left to the user. A cron job deleting files older than
10 days could do it: ::
find /var/www/cache -type f -mtime +10 | xargs -r rm
The module limits the compression of files to files smaller than 128 MByte and
larger than 128 Byte.
The lower limit is set as small files tend to become larger by compressing due
to the compression headers, the upper limit is set to work sensibly with
memory and cpu-time.
Directories containing a tilde ('~') are not created automatically (See ticket
#113). To enable compression for user dirs you have to create the directories