Website Compression with mod_deflate
I just added mod_deflate to my server by using the following configuration:
LoadModule deflate_module modules/mod_deflate.so
<IFModule mod_deflate.c>
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
</IFModule>
The static parts of my pages now render with about 70% compression, meaning that I’m saving 2/3 of static page bandwidth now. Server load seems fine!
This entry was posted on Saturday, June 9th, 2007 at 6:06 pm and is tagged with request uri, jpe, server load, gzip, png, text html, lt, bandwidth. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.


on June 9th, 2007 at 8:05 pm
Ok, I’m interested, where do I paste this code?
on June 10th, 2007 at 10:51 am
This goes in your httpd.conf file, of course!
on June 11th, 2007 at 12:47 am
Is there any mod_deflate package also to install?
or just edit the conf file?
on June 11th, 2007 at 5:09 am
It depends; I think the module is standard with apache 2.