Set content expiration in htaccess


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



Copy this code and paste it in your HTML
  1. # turn on the module for this directory
  2.  
  3. ExpiresActive on
  4.  
  5. # set default
  6.  
  7. ExpiresDefault "access plus 24 hours"
  8.  
  9. ExpiresByType image/jpg "access plus 1 months"
  10.  
  11. ExpiresByType image/gif "access plus 1 months"
  12.  
  13. ExpiresByType image/jpeg "access plus 1 months"
  14.  
  15. ExpiresByType image/png "access plus 1 months"
  16.  
  17. ExpiresByType text/css "access plus 1 months"
  18.  
  19. ExpiresByType text/javascript "access plus 1 months"
  20.  
  21. ExpiresByType application/javascript "access plus 1 months"
  22.  
  23. ExpiresByType application/x-shockwave-flash "access plus 1 months"

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.