Where and how do I set the expirey dates for images and other media, in order to enable leverage browser caching. I'm not sure if they go in my css file or in a file on the server somewhere. I am a designer/coder xhtml etc. so baby speak is appreciated. Thanks.
For static content the web servers usually send the file's last modified date in the [tt]Date[/tt] HTTP response header and calculate a unique value for the [tt]ETAG[/tt] response header.
When next time the user agent requests such file, it sends back the received date in an [tt]If-Modified-Since[/tt] HTTP request header and/or the ETAG in an [tt]If-None-Match[/tt] request header.
If the web server finds out based on the date and/or the ETAG that the file was not modified on the server so the file in the user agent's cache is still usable, sends back 304 Not Modified
HTTP response code and no data.
If you want to ask the user agent to not reuse the cached files forever but to request a fresh copy even if the cached one seems to be correct, then you can configure the web browser to send an [tt]Expires[/tt] HTTP response header. See the documentation of mod_expires.
I hope something written above answered your question. If not, please give us details about your goal.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.