Skip to content

Instantly share code, notes, and snippets.

@rajeshg
Created October 22, 2009 21:52
Show Gist options
  • Save rajeshg/216372 to your computer and use it in GitHub Desktop.
Save rajeshg/216372 to your computer and use it in GitHub Desktop.
<IfModule mod_deflate.c>
# Compress all content, manually excluding specified file types
# place filter 'DEFLATE' on all outgoing content
SetOutputFilter DEFLATE
# exclude uncompressible content via file type
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|rar|zip)$ no-gzip
# properly handle requests coming from behind proxies
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
# Properly handle old browsers that do not support compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment