Skip to content

Instantly share code, notes, and snippets.

@sheeplogh
Created December 3, 2013 07:38
Show Gist options
  • Save sheeplogh/7765418 to your computer and use it in GitHub Desktop.
Save sheeplogh/7765418 to your computer and use it in GitHub Desktop.
<Location />
### COMPRESS EVERYTHING EXCEPT IMAGES >> ###
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE(7/8) masquerades as Mozilla4, but it is fine
BrowserMatch \bMSIE\s(7|8) !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
### << COMPRESS EVERYTHING EXCEPT IMAGES ###
</Location>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment