: What headers do I need to set to allow my content to be cached without any sort of revalidation for a set amount of time? I'm going cross eyed looking at all the HTTP headers available for
I'm going cross eyed looking at all the HTTP headers available for controlling the caching of content.
What headers do I need to set I I want content to be cached:
For at most 24 hours (or any time period I choose)
With no re-validation
With no etags
I've realized that browsers are re-requesting my CSS, JS, and images on every page view. I want them to be able to cache these items for some amount of time without checking back in at all with my site.
My server does not support "if modified since" nor "etags". I have implemented a versioning system where the version of the resource is in the file name, so I can cache bust when the files are changed.
More posts by @Eichhorn148
1 Comments
Sorted by latest first Latest Oldest Best
The Expires header is the simplest. If you're using Apache you can set this by mime type using mod_expires. In your .htaccess:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 day"
ExpiresByType image/png "access plus 1 day"
</IfModule>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.