code_junkie

Website image caching with Apache

Nov 13th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. 200 /index.php?page=1234&action=list
  2. 304 /favicon.ico
  3. 304 /img/logo.png
  4. 304 /img/arrow.png
  5. (etc.)
  6.  
  7. ExpiresActive on
  8. ExpiresByType image/png "access plus 1 month"
  9. ExpiresByType image/gif "access plus 1 month"
  10. ExpiresByType image/jpeg "access plus 1 month"
  11. # css may change a bit sometimes
  12. ExpiresByType text/css "access plus 1 days"
  13.  
  14. # special MIME type for icons - see http://www.iana.org/assignments/media-types/image/vnd.microsoft.icon
  15. AddType image/vnd.microsoft.icon .ico
  16. # now we have icon MIME type, we can use it
  17. # my favicon doesn't change much
  18. ExpiresByType image/vnd.microsoft.icon "access plus 3 months"
  19.  
  20. Expires: Fri, 1 Jan 2010 00:00:01 GMT
  21.  
  22. Alias /favicon.ico "/var/www/html/favicon.ico"
  23. <Directory "/var/www/html">
  24. <Files favicon.ico>
  25. ExpiresActive On
  26. ExpiresDefault "access plus 1 month"
  27. </Files>
  28. </Directory>
  29.  
  30. ExpiresByType image/ico "access plus 1 month"
Add Comment
Please, Sign In to add comment