Posted By

czachor on 11/04/11


Tagged

htaccess cache


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

naphetz
RhuanGonzaga


htaccess site caching


 / Published in: Apache
 

  1. # 1 YEAR
  2. <FilesMatch "\.(ico|pdf|flv)$">
  3. Header set Cache-Control "max-age=29030400, public"
  4. </FilesMatch>
  5. # 1 WEEK
  6. <FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
  7. Header set Cache-Control "max-age=604800, public"
  8. </FilesMatch>
  9. # 2 DAYS
  10. <FilesMatch "\.(xml|txt|css|js)$">
  11. Header set Cache-Control "max-age=172800, proxy-revalidate"
  12. </FilesMatch>
  13. # 1 MIN
  14. <FilesMatch "\.(html|htm|php)$">
  15. Header set Cache-Control "max-age=60, private, proxy-revalidate"
  16. </FilesMatch>

Report this snippet  

You need to login to post a comment.