Cache Images Apache Server


/ Published in: Apache
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # 1 YEAR
  2. <FilesMatch "\.(ico|pdf|flv)$">
  3. Header set Cache-Control "max-age=29030400, public"
  4. </FilesMatch>
  5.  
  6. # 1 WEEK
  7. <FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
  8. Header set Cache-Control "max-age=604800, public"
  9. </FilesMatch>
  10.  
  11. # 2 DAYS
  12. <FilesMatch "\.(xml|txt|css|js)$">
  13. Header set Cache-Control "max-age=172800, proxy-revalidate"
  14. </FilesMatch>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.