Skip to content

Instantly share code, notes, and snippets.

@alkavan
Created November 9, 2010 23:29
Show Gist options
  • Save alkavan/670040 to your computer and use it in GitHub Desktop.
Save alkavan/670040 to your computer and use it in GitHub Desktop.
Apache 2.2 mod_deflate configuartion
#
# my mod_deflate settings, it's important not to uncomment last AddOutputFilterByType!
#
<IfModule mod_deflate.c>
DeflateCompressionLevel 7
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
AddOutputFilterByType DEFLATE application/javascript application/x-javascript
#AddOutputFilterByType DEFLATE application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
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|doc)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|mp4|rm)$ no-gzip dont-vary
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment