jasteele123

mod_deflate / mod_expires

Oct 11th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. <IfModule mod_deflate.c>
  2. # compress text, html, javascript, css, xml:
  3. AddOutputFilterByType DEFLATE text/plain
  4. AddOutputFilterByType DEFLATE text/html
  5. AddOutputFilterByType DEFLATE text/xml
  6. AddOutputFilterByType DEFLATE text/css
  7. AddOutputFilterByType DEFLATE application/xml
  8. AddOutputFilterByType DEFLATE application/xhtml+xml
  9. AddOutputFilterByType DEFLATE application/rss+xml
  10. AddOutputFilterByType DEFLATE application/javascript
  11. AddOutputFilterByType DEFLATE application/x-javascript
  12. </IfModule>
  13.  
  14. <IfModule mod_expires.c>
  15. Header unset Pragma
  16. FileETag None
  17. Header unset ETag
  18. # Turn on Expires and set default to 0
  19. ExpiresActive On
  20. ExpiresDefault A0
  21. # Set up caching on media files for 1 year (forever?)
  22. <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|gif|jpg|jpeg|png|swf)$">
  23. ExpiresDefault A29030400
  24. Header append Cache-Control "public"
  25. </FilesMatch>
  26. # Set up 31 days caching on commonly updated files
  27. <FilesMatch "\.(xml|txt|html|js|css)$">
  28. ExpiresDefault A2678400
  29. Header append Cache-Control "proxy-revalidate"
  30. </FilesMatch>
  31. # Force no caching for dynamic files
  32. <FilesMatch "\.(php|cgi|pl|htm)$">
  33. ExpiresActive Off
  34. Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
  35. Header set Pragma "no-cache"
  36. </FilesMatch>
  37. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment