Want more features on Pastebin? Sign Up, it's FREE!

apache compression

By: Pothi on Jan 29th, 2012  |  syntax: None  |  size: 1.27 KB  |  views: 65  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ### Enable HTTP Compression
  2. <Location />
  3. # Insert filter
  4. SetOutputFilter DEFLATE
  5.  
  6. # Netscape 4.x has some problems...
  7. BrowserMatch ^Mozilla/4 gzip-only-text/html
  8.  
  9. # Netscape 4.06-4.08 have some more problems
  10. BrowserMatch ^Mozilla/4\.0[678] no-gzip
  11.  
  12. # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
  13. # the above regex won't work. You can use the following
  14. # workaround to get the desired effect:
  15. BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
  16.  
  17. # Don't compress images & favicon
  18. SetEnvIfNoCase Request_URI \
  19. \.(?:gif|jpe?g|png|ico)$ no-gzip dont-vary
  20.  
  21. # Make sure proxies don't deliver the wrong content
  22. Header append Vary User-Agent env=!dont-vary
  23. </Location>
  24.  
  25. ExpiresActive on
  26. ExpiresDefault "access plus 5 weeks"
  27. ExpiresByType image/jpg "access plus 8 weeks"
  28. ExpiresByType image/gif "access plus 8 weeks"
  29. ExpiresByType image/jpeg "access plus 8 weeks"
  30. ExpiresByType image/png "access plus 8 weeks"
  31. ExpiresByType text/css "access plus 8 weeks"
  32. ExpiresByType text/javascript "access plus 8 weeks"
  33. ExpiresByType application/javascript "access plus 8 weeks"
  34. # HTML documents are good for a week from the time they were changed
  35. ExpiresByType text/html M604800
  36.  
  37. ### For favicon
  38. AddType image/x-icon .ico
  39. ExpiresByType image/x-icon  "access plus 8 weeks"
clone this paste RAW Paste Data