Subresources of stylesheets (images / @import / ...) don't get revalidated if the image comes from the memory cache (was: Expires/Cache-Control header is not respected when set on a imported css file)
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: a7a.i.nt, Unassigned)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
120 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
Steps to reproduce:
when a cached css file (Cache-Control:max-age=3600000) imports another one (b) the expires header from b is not respected.
This also is the case when setting bs max-age or even no-cache.
Actual results:
cached version of b is used, even through it is expired
Expected results:
b should have been reloaded when it got expired/ max-age was reached
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
|
||
So this is a bit tricky to fix... The underlying issue is that the memory cache is keeping the stylesheet alive, and that keeps alive all the imported stylesheets, including the one that's expired.
Do you know if this is a regression? If so this is probably one from bug 1599160...
A quick but non-ideal fix would be to basically make SheetLoadData::mExpirationTime
be the minimum expiration time of all stylesheets in the subtree, or such. That wouldn't be amazing because that'd make us re-parse all the stylesheets in that subtree, but maybe it's fine.
Comment 3•4 years ago
|
||
Hmm, I suspect this is technically also an issue for CSS images and such...
Comment 4•4 years ago
|
||
Interestingly, in Chrome even shift-reload won't stop the cached subresource from getting used (in Firefox you can at least do that...).
WebKit behaves as I'd expect I think.... Looking at the source they explicitly have a bunch of code to support this. Not a great fan of that approach, ideally we'd trigger loads for the individual subresources if we need to revalidate them. That's potentially even more complex though.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Description
•