Configuring the mod_deflate directive

For specific instructions to configure the mod_deflate directive, access the Apache documentation on this web page, http://httpd.apache.org/docs/2.0/, and click on the link for http://httpd.apache.org/docs/2.0/mod/directives.html. Refer to this web page for instructions to configure each of the parameters discussed below. Also refer to the sample mod_deflate module at the end of this appendix.

To enable compression, open the httpd.conf file, and verify that the LoadModule deflate_module is uncommented (see the example below). You can configure mod_deflate to compress documents in one of two ways (both of which are specified in the httpd.conf file):

  • Explicit exclusion of files by extension

    This method lists the file types that should NOT be compressed by the http server.

  • Explicit inclusion of files by MIME type.

    This method lists file types that should always be compressed by the http server.