Closed SCmkQrK1NhwcWoPJF3FImaqHnG2PqPLWBt2GtSU closed 5 years ago
This is unfortunately a side effect of the fix to https://github.com/uBlockOrigin/uBlock-issues/issues/42 -- in which the workaround suggested by Firefox devs in https://bugzilla.mozilla.org/show_bug.cgi?id=1376932 was used.
I am experimenting and it seems if I just use no-cache
instead of no-cache, no-store, must-revalidate
, I still cannot reproduce #42, and that also seems to fix the offline issue reported here.
I am going to revert the fix here -- the side effects are undesirable for whoever does not care to work in offline mode.
Since either ways cause side effects which may not be acceptable to group of users, I will add an advanced setting to let users configure how uBO should affect caching for the purpose of dealing with https://bugzilla.mozilla.org/show_bug.cgi?id=1376932.
The default value will be the one used before, i.e. the one causing the issue here.
New advanced setting: cacheControlForFirefox1376932
.
Default value: no-cache, no-store, must-revalidate
.
If using no-cache, no-store, must-revalidate
:
If using no-cache
:
This new advanced setting will be removed once https://bugzilla.mozilla.org/show_bug.cgi?id=1376932 is fixed.
Firefox bug has been closed. I will like to test, but don't see a way to configure cacheControlForFirefox1376932
to not be applied.
@gwarser Were you able to test afterall ?
Testing all the time, and I think it works.
example.com
, Reddit, GitHub with no-remote-fonts
or example.com##^a
/github.com##^img
/example.com##^a
loads fine from cache in offline mode with filters applied. I want to check https://github.com/uBlockOrigin/uBlock-issues/issues/42 again.
~I think this can be permanently disabled for Firefox 70.~
Hmmm. Something is racing. When testing on https://old.reddit.com/
with reddit.com##^img
thumbnails placeholders are sometimes visible after refresh (<img>
is present).
HTML filtering is not applied on session restore: https://www.amazon.com/
with amazon.com##^img
, but this may be different issue.
No glitches when using CSP
||amazon.com^$csp=img-src 'none'
||reddit.com^$csp=img-src 'none'
Is this fixed or just closed? I see still in advanced settings that it is not empty, but as it appears at the beginning of this issue. This file can't be loaded from cache, and I have to wait about 1 minute just for it to load when editing data on IMDb pages like this one: https://contribute.imdb.com/updates?edit=tt2543472/keywords&ref_=ttkw_kw_edt Direct url of that resource is: https://m.media-amazon.com/images/I/A1m0xZZQVsL.js So if I wanna increase cache efficiency aka reduce network usage and waiting, I just use no-cache? If I don't care about being tracked a little or get few ads a little? What is difference between no-cache and nothing there? I care about speed and reduced data usage, and I already disabled cache partitioning and rcwn, and my net speed is 4 kB/s. Yup, very slow, kind of ultra slow 2G in village, so I feel the differences more than anybody. OK, I just tried no-cache header only, but still it reloads on each page load. Even after restarting Firefox. What am I supposed to do? I would care less if I had faster Internet. I wanna use my cache more. I tried using Redirector extension to copy that file to my local server and load from there, but it said it could not because of csp. So sure we are talking same issue here.
Still don't understand. Why can't I use cached js file? Why does it have to reload from network always? Tried both advanced options, result is same. Should I try to somehow exclude whole file or site from uBlock? Is there option in uBlock to disable html filtering or whatever is causing this? What are consequences? This is caused by HTML filtering (injection)?
OK, I tested with all addons disabled (safe mode). And still this js file does not want to be cached. Even if I try loading it by pressing Enter key on url, or by pressing refresh key. However when I open file url directly, it is cached. Just not on contribute.imdb.com. So not uBlock issue. But can't understand why this is happening. Maybe best to block it and hope page will work without issues. (Screenshot is with addons still enabled, but I also tested with all of them disabled.)
The referenced Bugzilla issue (https://bugzilla.mozilla.org/show_bug.cgi?id=1376932) was closed with status RESOLVED FIXED, 5 years ago.
As I see, the cache control workaround setting still uses no-cache, no-store, must-revalidate
. Is that really still needed? Was the Bugzilla issue closed by mistake?
As I understand, websites not being available offline is not the only downside of this setting, but also more network usage which is quite bad for those on a mobile data connection, and besides that battery drain when the user is on a slow connection, limited by the network provider.
@gorhill Sorry, is the one in this reddit thread related to this issue? OP also used no-remote-fonts: * true
https://old.reddit.com/r/uBlockOrigin/comments/1dz6du7/i_managed_to_break_firefoxs_asset_caching/
Not directly related, the issue is injecting a CSP header in non-document resources, this also happen in Chromium as can be seen in logger when forcing a reload with cache bypass. Chromium is seemingly unaffected because it does not have that special code path taken in Firefox which also inject a cache invalidation header.
I am not sure how far in the past is the regression, I believe at some point a test for document resource might have been removed, leading to the current issue of injecting CSP header in non-document resource. I will work on a fix.
This is the regression, a test for document resource was removed, leading to the reported issue:
Implement network filter option replace=
(Nov 2023)
Prerequisites
Description
When uBlock blocks remote fonts, the downloaded pages (except images) in the disk cache are not stored correctly: they are not then loaded offline, but should be loaded.
A specific URL where the issue occurs
https://example.com/
Steps to Reproduce
Expected behavior:
The page will load from the cache.
Actual behavior:
The page will not load from the cache.
Your environment