Cover V12, I08
aug2003.tar

Compression Levels

GZIP allows for nine levels of compression, ranging from 1 (low compression ratio, high compression speed) to 9 (high compression ratio, low compression speed). By default, mod_deflate (Apache/2.0.45 and higher) and mod_gzip both use compression level 6, which is regarded as a good balance between speed and compression ratio.

Using a single text file as an example, the following results are obtained by using the command gzip -X <filename>, where X is the compression level specified:

Original File 56380 bytes
Compression Level 1 19833 bytes
Compression Level 2 18850 bytes
Compression Level 3 18125 bytes
Compression Level 4 17219 bytes
Compression Level 5 16593 bytes
Compression Level 6 16348 bytes
Compression Level 7 16302 bytes
Compression Level 8 16284 bytes
Compression Level 9 16283 bytes

If you are using Apache/2.0.44 or lower, the default compression level is defaulted to 1. This can be adjusted using the method outlined at http://www.webcompression.org/mod_deflate-hack.php, or by upgrading to Apache/2.0.45.