.htaccess 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # BEGIN Compress text files
  2. <ifModule mod_deflate.c>
  3. <filesMatch ".(css|js|x?html?|php)$">
  4. SetOutputFilter DEFLATE
  5. </filesMatch>
  6. </ifModule>
  7. # END Compress text files
  8. # BEGIN Expire headers
  9. <ifModule mod_expires.c>
  10. ExpiresActive On
  11. ExpiresDefault "access plus 1 seconds"
  12. ExpiresByType image/x-icon "access plus 2592000 seconds"
  13. ExpiresByType image/jpeg "access plus 2592000 seconds"
  14. ExpiresByType image/png "access plus 2592000 seconds"
  15. ExpiresByType image/gif "access plus 2592000 seconds"
  16. ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  17. ExpiresByType text/css "access plus 604800 seconds"
  18. ExpiresByType text/javascript "access plus 216000 seconds"
  19. ExpiresByType application/javascript "access plus 216000 seconds"
  20. ExpiresByType application/x-javascript "access plus 216000 seconds"
  21. ExpiresByType text/html "access plus 600 seconds"
  22. ExpiresByType application/xhtml+xml "access plus 600 seconds"
  23. </ifModule>
  24. # END Expire headers
  25. # BEGIN Cache-Control Headers
  26. <ifModule mod_headers.c>
  27. <filesMatch ".(ico|jpe?g|png|gif|swf)$">
  28. Header set Cache-Control "max-age=2592000, public"
  29. </filesMatch>
  30. <filesMatch ".(css)$">
  31. Header set Cache-Control "max-age=604800, public"
  32. </filesMatch>
  33. <filesMatch ".(js)$">
  34. Header set Cache-Control "max-age=216000, private"
  35. </filesMatch>
  36. <filesMatch ".(x?html?|php)$">
  37. Header set Cache-Control "max-age=600, private, must-revalidate"
  38. </filesMatch>
  39. </ifModule>
  40. # END Cache-Control Headers
  41. # BEGIN Turn ETags Off
  42. <ifModule mod_headers.c>
  43. Header unset ETag
  44. </ifModule>
  45. FileETag None
  46. # END Turn ETags Off
  47. # BEGIN gzip
  48. <ifModule mod_gzip.c>
  49. mod_gzip_on Yes
  50. mod_gzip_dechunk Yes
  51. mod_gzip_item_include file .(html?|txt|css|js)$
  52. mod_gzip_item_include handler ^cgi-script$
  53. mod_gzip_item_include mime ^text/.*
  54. mod_gzip_item_include mime ^application/x-javascript.*
  55. mod_gzip_item_exclude mime ^image/.*
  56. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  57. </ifModule>
  58. # END gzip