Guest User

cache htaccess

a guest
Jul 5th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. #Compressing Code
  2. <ifModule mod_headers.c>
  3. Header unset ETag
  4. </ifModule>
  5. FileETag None
  6. <ifModule mod_headers.c>
  7. Header unset Last-Modified
  8. </ifModule>
  9. <ifModule mod_headers.c>
  10. <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
  11. Header set Cache-Control "max-age=2592000, public"
  12. </filesMatch>
  13. <filesMatch "\\.(css)$">
  14. Header set Cache-Control "max-age=604800, public"
  15. </filesMatch>
  16. <filesMatch "\\.(js)$">
  17. Header set Cache-Control "max-age=216000, private"
  18. </filesMatch>
  19. <filesMatch "\\.(xml|txt)$">
  20. Header set Cache-Control "max-age=216000, public, must-revalidate"
  21. </filesMatch>
  22. <filesMatch "\\.(html|htm|php)$">
  23. Header set Cache-Control "max-age=1, private, must-revalidate"
  24. </filesMatch>
  25. </ifModule>
  26. <ifModule mod_expires.c>
  27. ExpiresActive On
  28. ExpiresDefault "access plus 1 seconds"
  29. ExpiresByType text/html "access plus 1 seconds"
  30. ExpiresByType image/gif "access plus 2592000 seconds"
  31. ExpiresByType image/jpeg "access plus 2592000 seconds"
  32. ExpiresByType image/png "access plus 2592000 seconds"
  33. ExpiresByType text/css "access plus 604800 seconds"
  34. ExpiresByType text/javascript "access plus 216000 seconds"
  35. ExpiresByType application/x-javascript "access plus 216000 seconds"
  36. </ifModule>
  37. <ifModule mod_gzip.c>
  38. mod_gzip_on Yes
  39. mod_gzip_dechunk Yes
  40. mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  41. mod_gzip_item_include handler ^cgi-script$
  42. mod_gzip_item_include mime ^text/.*
  43. mod_gzip_item_include mime ^application/x-javascript.*
  44. mod_gzip_item_exclude mime ^image/.*
  45. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  46. </ifModule>
Advertisement
Add Comment
Please, Sign In to add comment