mod_deflate
Compress content before it is delivered to the client
Extension
mod_deflate.c
deflate_module

The mod_deflate module provides the `DEFLATE` output filter that allows output from your server to be compressed before being sent to the client over the network.

AddOutputFilter
SetOutputFilter

# Enabling Compression

Compression is implemented by the `DEFLATE` filter. The following directive will enable compression for documents in the container where it is placed:

Most popular browsers can not handle compression of all content so you may want to set the 'gzip-only-text/html' note to 1 to only allow html files to be compressed (see below).

If you set this to anything but '1' it will be ignored, so you can do negative matches.

SetEnv gzip-only-text/html 1
SetOutputFilter DEFLATE

Here is an example of enabling compression for the Apache documentation:

<Directory "/your-server-root/manual">
SetEnv gzip-only-text/html 1
SetOutputFilter DEFLATE
</Directory>
DeflateFilterNote
Places the compression ratio in a note for logging
DeflateFilterNote notename
server config
virtual host

The DeflateFilterNote directive specifies that a note about compression ratios should be attached to the request. The name of the note is the value specified for the directive.

DeflateBufferSize
Fragment size to be compressed at one time by zlib
DeflateBufferSize value
DeflateBufferSize 8096
server config
virtual host

The DeflateBufferSize directive specifies the size in bytes of the fragments that zlib should compress at one time.

DeflateWindowSize
Zlib compression window size
DeflateWindowSize value
DeflateWindowSize 15
server config
virtual host

The DeflateWindowSize directive specifies the zlib compression window size (a value between 1 and 15).

DeflateMemLevel
How much memory should be used by zlib for compression
DeflateMemLevel value
DeflateMemLevel 9
server config
virtual host

The DeflateMemLevel directive specifies how much memory should be used by zlib for compression (a value between 1 and 9).