ETag and expire headers for drupal 7


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

yslow optimization


Copy this code and paste it in your HTML
  1. # Cache specified files for 31 days
  2. <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|swf)$">
  3. Header set Cache-Control "max-age=2678400, public"
  4. </filesmatch>
  5. # Cache HTML files for a couple hours
  6. <filesmatch "\.(html|htm)$">
  7. Header set Cache-Control "max-age=7200, private, must-revalidate"
  8. </filesmatch>
  9. # Cache PDFs for a day
  10. <filesmatch "\.(pdf)$">
  11. Header set Cache-Control "max-age=86400, public"
  12. </filesmatch>
  13. # Cache CSS for 6 days
  14. <filesmatch "\.(css|css.gz)$">
  15. Header set Cache-Control "max-age=518400, private"
  16. </filesmatch>
  17. # Cache Javascripts for 31 days
  18. <filesmatch "\.(js|js.gz)$">
  19. Header set Cache-Control "max-age=2678400, private"
  20. </filesmatch>
  21.  
  22. Header append Vary Accept-Encoding
  23. # Turn ETags Off
  24. <IfModule mod_headers.c>
  25. </IfModule>
  26.  
  27. FileETag None

URL: http://blog-das-oertchen.de/blog/2011/02/15/drupal-sinnvolle-optimierungen-teil-3

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.