Skip to content

Instantly share code, notes, and snippets.

@jonathanstark
Created September 26, 2015 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanstark/bfe056f2486ff9223510 to your computer and use it in GitHub Desktop.
Save jonathanstark/bfe056f2486ff9223510 to your computer and use it in GitHub Desktop.
GZIP stuff for Apache .htaccess file
####################
# GZIP COMPRESSION #
####################
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
Header append Vary User-Agent env=!dont-vary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment