kieranbarnes do you know where your towel is?

Apache2 mod_deflate

Posted on July 3, 2007

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.

Lazy man's description, your pages load quicker.

Add the following code to your httpd.conf

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
\.(?:exe|t?gz|zip|bz2|sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

I like to log things for no real reason

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_log deflate

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. Enabling mod_deflate/gzip globally on cPanel
    There's far too many reasons to mention why you should enable mod_deflate to gzip your...
  2. My Best Firefox Extensions
    I've got several Firefox extensions that I simply cannot live without these days. British English...
  3. NTLM Authentication on Ubuntu and Apache2 Revisited
    It's been a while since I've had to build an NTLM integrated Apache2 server. So...
  4. Auto Updating GeoIP Binary Databases
    Here's how I keep on top of updating the GeoIP binary databases used by various...

What this article useful to you?



Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the Linux category.

Filed under: Linux Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.