max-age and browser cache
-
I’ve been wondering about the max-age value and how browser cache works exactly.
My understanding is that max-age defines a unit of time in seconds (relative to the time of the request) for which the response is deemed ‘fresh’.
This
Cache-Control
header tells the browser that it can use this file from the
cache for the next 60 seconds without having to worry about revalidating it.
Once the 60 seconds is up, the browser will head back to the server to
revalidate the file.The plugins works and the correct headers are showing, but I am a little unsure about the max-age and browser cache behaviour.
If I view my page once it will be cached in the browser, if I reload the page before the max-age value then shouldn’t it use the cached version in my browser.
For example css and js files are served from memory cache, shouldn’t that also apply for the html which is also now being cached. So the size being transferred should be 0.
- The topic ‘max-age and browser cache’ is closed to new replies.