I'm requesting a css file over HTTP from Chrome (Version 93.0.4577.63 (Official Build) (64-bit)). The initial request looks like this:
As you can see, it has Cache-Control: no-cache
in the request.
Doesn't this mean it first has to check with the server whether or not its version of the css file is up to date?
In which case it should get a 304 Not Modified
(assuming the file hasn't been modified) on the next request?
Here's the request/response when I did a refresh of the page:
Why am I getting a 200 (from disk cache)
and not a 304 Not Modified
?
The issue is that some users of this website are getting an out of date version of the css file.
I suspect it's because the cached version is being returned before being revalidated with the server which is what I thought no-cache
was meant to do.
Update:
I'm not sure why, but when I did refresh again, I got fewer headers in the request:
I didn't have the Disable cache button checked