Forum Moderators: phranque
In order to do this i must be sure that anyone accessing the linking site sends a request to the image at least daily.
I understand that to do so i must use the "expires" http header, however i have no idea how to do this for an image that is accessed directly. Anyway i can do this by adding directives to httpd.conf?
What would be perfect would be to allow the browser to cache the image (if i can avoid it to be downloaded everytime it's only better), but to have it send an http request at least once a day (even if it is to get a 304-unmodified response, the point is to get an entry in my log).
Thanks for any help on how to achieve this.
Welcome to WebmasterWorld [webmasterworld.com]!
I dealt with this problem several years ago, and never found a good example that included both the headers and the directives needed to implement them. So straight off one of my servers:
ExpiresActive On
# Default - Set http header to expire everything 2 weeks from last access, set must-revalidate
ExpiresDefault A604800
Header append Cache-Control: "must-revalidate"
#
# Apply a customized Cache-Control header to frequently-updated pages
<FilesMatch "^(index¦news)\.html$">
ExpiresDefault A2400
Header unset Cache-Control:
Header append Cache-Control: "no-cache, must-revalidate"
# Apply a customized Cache-control header to tracker gifs
</FilesMatch>
#
# Apply a customized Cache-Control header to custom error pages
<FilesMatch "^(403¦404¦410)\.html$">
ExpiresDefault A0
Header unset Cache-Control:
Header append Cache-Control: "no-cache, must-revalidate"
</FilesMatch>
#
# Apply a customized Cache-control header to tracker gifs
<FilesMatch "tracker\.gif)$">
ExpiresDefault A0
Header unset Cache-Control:
Header append Cache-Control: "no-cache, must-revalidate"
</FilesMatch>
Note that the broken pipe "¦" character in the code above must be replaced with a solid pipe character from your keyboard before use -- Posting on this board modifies the the original solid pipe character.
Ref:
http://www.mnot.net/cache_docs/
http://webmaster.info.aol.com/caching.html
Tools:
http://www.ircache.net/cgi-bin/cacheability.py?
[webmasterworld.com...]
Jim
thanks again