kieranbarnes Independent PHP, WordPress & CubeCart Programmer

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


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...
  5. Site Performance Quick Fixes
    I've been playing around with YSlow for a while now, now I decided to a...

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.