How to save bandwidth using mod_deflate

The Apache2 module mod_deflate enables support for HTTP compression. This can save you bandwidth and will generally speed up access to your site a little. It can even save resources on the server in some circumstances, as although more CPU is used per-request, over-all there are may be slightly fewer concurrent connections at any one time.

It's quick and simple to enable mod_deflate it the Debian way:

a2enmod deflate

/etc/apache2/mods-available/deflate.conf

<IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/xml

        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

        DeflateFilterNote Input input_info
        DeflateFilterNote Output output_info
        DeflateFilterNote Ratio ratio_info
        LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
        CustomLog /var/log/apache2/deflate_log deflate

</IfModule>
/etc/init.d/apache2 restart

There's a web-based tool to check your server for HTTP compression support here:

http://www.microsoft.com/search/Tools/default.aspx

Discussion

Enter your comment (wiki syntax is allowed):

Subscribe to the RSS feed for Andy's Debian HOWTOs

Article from Andy's Debian HOWTOs (http://www.besy.co.uk/debian/debian)

 
debian/how_to_enable_mod_default_to_save_bandwidth.txt · Last modified: 2008/08/01 23:56 (external edit) · [Old revisions]
Recent changes RSS feed Powered by Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki