Advertisement
Pothi

apache compression

Jan 29th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  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"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement