Advertisement
Aurangajeb

Avoid Leverage browser caching (Serve Static Assets With an Efficient Cache Policy) httaccess rules

Dec 9th, 2020
1,155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Adding Cache-Control Headers
  2. <filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|svg|js|css|swf)$">
  3. Header set Cache-Control "max-age=84600, public"
  4. </filesMatch>
  5.  
  6. ## EXPIRES HEADER CACHING ##
  7. <IfModule mod_expires.c>
  8. ExpiresActive On
  9. ExpiresByType image/jpg "access 1 year"
  10. ExpiresByType image/jpeg "access 1 year"
  11. ExpiresByType image/gif "access 1 year"
  12. ExpiresByType image/png "access 1 year"
  13. ExpiresByType image/svg "access 1 year"
  14. ExpiresByType text/css "access 1 month"
  15. ExpiresByType application/pdf "access 1 month"
  16. ExpiresByType application/javascript "access 1 month"
  17. ExpiresByType application/x-javascript "access 1 month"
  18. ExpiresByType application/x-shockwave-flash "access 1 month"
  19. ExpiresByType image/x-icon "access 1 year"
  20. ExpiresDefault "access 2 days"
  21. </IfModule>
  22. ## EXPIRES HEADER CACHING ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement