Loading

.htaccess mod_deflate

  1. <IfModule mod_deflate.c>
  2.     SetOutputFilter DEFLATE
  3.     <IfModule mod_setenvif.c>
  4.         # Netscape 4.x has some problems...
  5.         BrowserMatch ^Mozilla/4 gzip-only-text/html
  6.        
  7.         # Netscape 4.06-4.08 have some more problems
  8.         BrowserMatch ^Mozilla/4\.0[678] no-gzip
  9.        
  10.         # MSIE masquerades as Netscape, but it is fine
  11.         # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  12.        
  13.         # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
  14.         # the above regex won't work. You can use the following
  15.         # workaround to get the desired effect:
  16.         BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
  17.        
  18.         # Don't compress images
  19.         SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
  20.     </IfModule>
  21.    
  22.     <IfModule mod_headers.c>
  23.         # Make sure proxies don't deliver the wrong content
  24.         Header append Vary User-Agent env=!dont-vary
  25.     </IfModule>
  26. </IfModule>