Open Bug 1327519 Opened 7 years ago Updated 6 months ago

"Work offline" mode forces browser to use cache even if it's disabled in devtools and via Ctrl+Shift+R

Categories

(DevTools :: Netmonitor, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: arni2033, Unassigned)

References

(Blocks 2 open bugs)

Details

>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160526082509
STR_1:
1. Open http://eadaily.com/ru/news/2016/05/23/kak-i-zachem-rossiya-soderzhit-belorussiyu
2. Open devtools -> netmonitor
3. Reload the page several times until you see enough "cached" https entries in netmonitor
4. In devtools options, enable checkbox "Disable HTTP Cache"
   Disable internet connection, press F10 to show menu bar, click File -> Work Offline.
5. Press Ctrl+Shift+R to reload the page without using cache

AR:  Many http entries in netmonitor are shown as "cached"
ER:  No cached entries. I did everything in order not to use cache. Steps 4-5 are overkill

This was a terrible bug! And I don't even know under which component exactly it fails: I think that if
I exclude devtools from STR, "work offline" mode still uses cache (which one?!) after Ctrl+Shift+R...
This is confusing. Please, you investigate this, or explain to me why this is intended behavior.
No longer blocks: 1277113
User Agent:  Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0

I have tested this issue on Windows 10 x64 with the latest Firefox release (50.1.0) and the latest Nightly (53.0a1-20170105030229) and managed to reproduce it as described by the reporter.

I will assign the "Core: Networking: Cache" component and perhaps there's someone with extensive knowledge on this area that might be able to help here.
Component: Untriaged → Networking: Cache
Product: Firefox → Core
I'm not sure this is a bug - that's pretty much the definition of work offline (to go from cache only). I guess this could be resolved by just having everything fail, is that really better?
I encountered this bug when I reloaded local page to make sure it doesn't use external sources.
Comment 0 seem to expect checkbox "Disable HTTP Cache" to work.
If checkbox "Disable HTTP Cache" should keep HTTP cache enabled, then of course this is not a bug...
Though I would prefer it to be disabled and show tooltip with explanation in this case.
We do this pretty much intentionally at [1] for years.

When the browser is offline, we use the cache (to read only from) regardless any "bypass cache" load flags - which are set [2] when "Disable HTTP cache" is checked in dev tools.

This may be considered a UI problem as described in comment 3.  Or we may introduce another flag or channel property to bypass the cache even when offline.

[1] https://dxr.mozilla.org/mozilla-central/rev/845cc4dea57f6cc93f46810d24b1058b640c3b74/netwerk/protocol/http/nsHttpChannel.cpp#3533
[2] https://dxr.mozilla.org/mozilla-central/rev/845cc4dea57f6cc93f46810d24b1058b640c3b74/devtools/server/actors/tab.js#1048
Component: Networking: Cache → Developer Tools: Netmonitor
Product: Core → Firefox
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.