Adding a local script override should disable cache
Categories
(DevTools :: Netmonitor, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Unassigned)
References
(Blocks 1 open bug)
Details
The local script override feature can seem broken when the user has not disabled the cache because the website might still use the regular (cached) version, and not the override.
Chrome seems to Disable cache automatically when setting up an override or when updating an override.
We could do something similar and disable the cache when updating a network override. However since we can't edit the overrides directly in Firefox, it's a bit more difficult for us to force disabling the cache again in case an override changed. But we could at least show a warning if an override applies to the current domain and we see that the cache is not disabled.
Comment 1•1 year ago
|
||
Am I correct that the issue here are:
- (1) for cached responses, there's no response data available, and adding an override creates an empty file
- (2) for some case, the observer notification isn't triggered and the cached data is used
I've observed (1) and added testcase that verifies the "current" behavior as bug 1947001 patches.
for (2), I've observed the issue with stylesheets where the in-memory cached files aren't overridden.
for scripts, it will always trigger the observer notification unless the SharedScriptCache is enabled,
and I've added a prototype patch to fix those issues in bug 1947001.
| Reporter | ||
Comment 2•1 year ago
|
||
Thanks for looking into this! This bug was really just about disabling the cache globally for the tab when setting an override, mostly to avoid use case (2). It sounds great to have a way to bust the cache individually for overridden requests. It's probably better than having to disable cache globally :)
Regarding (1), this was not really in scope of this bug. We probably have a few scenarios where the initial override might be empty, so thanks a lot for fixing one of those!
With the fixes on bug 1947001, do you think there will still be scenarios where overridden files might be read from the cache?
(and thanks again for investigating this topic!)
Comment 3•1 year ago
|
||
For StyleSheets and JavaScripts, as long as the in-memory cache is cleared for the overridden case (with bug 1947001) and the overridden response is not cacheable,
all subsequent requests will hit the observer notification and the override will work every time.
The testcase in the bug verifies simple cases, but it might be nice to verify some more scenario, to see the overridden response is never cacheable.
If the override feature is also applicable to images, then the image cache should also be cleared.
It could possibly be done with imgICache::removeEntry, but haven't yet verified.
For other resources (HTML, font, video, etc?), I don't know much.
| Reporter | ||
Updated•11 months ago
|
Description
•