Closed Bug 1253018 Opened 8 years ago Closed 8 years ago

Rename "Disable Cache" option to "Disable HTTP Cache"

Categories

(DevTools :: General, defect, P1)

defect

Tracking

(firefox47 affected, firefox49 fixed)

RESOLVED FIXED
Firefox 49
Tracking Status
firefox47 --- affected
firefox49 --- fixed

People

(Reporter: callahad, Assigned: jryans)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, DevAdvocacy, Whiteboard: [btpp-fix-now][DevRel:P2])

Attachments

(1 file)

STR:

1. Open DevTools, Enable "Disable Cache (when toolbox is open)" under advanced settings.
2. Switch to the Network tool
3. Visit https://www.pokedex.org/
4. Refresh the page

What should happen:

- The requests hit the network, since caches are disabled

What actually happens:

- All requests are served from the service worker's cache

You can also verify this by visiting an inert page, https://www.pokedex.org/manifest.json, and running the following in the console:

    caches.match('/img/icon-48.png').then(x => console.log(`Resource ${(x && x.ok) ? "WAS" : "WAS NOT"} found in cache:`, x))

This demonstrates that the `caches` object exists and is fully functional, even when caches are disabled in the Dev Tools. This makes it much more difficult to debug Service Worker behavior re: cache misses or an empty cache.
Blocks: 1253031
Sounds similar to this existing web worker version, bug 1047663.
See Also: → 1047663
AFAICT, the type of worker is the only difference I see between this bug (Service Workers) and Bug 1047663 (Web Workers).

It might be worth leaving this one open, programmatic caches are an explicit feature of Service Workers.
Yep, let's keep it open so we can retest after bug 1047663.
Priority: -- → P2
Whiteboard: [btpp-fix-later]
Seems pretty critical for our recent push around SW.
Priority: P2 → P1
Whiteboard: [btpp-fix-later] → [btpp-fix-now]
What is the bug even asking for?  "SW caches" are a manual API that script uses.  How are you going to disable that?

Or are you asking to bypass the service worker when this flag is set?  I've been working hard to make sure service workers continue to work in these cases.  In my experience helping developers with problems in the wild they seem to expect service worker fetch events to still fire even with "disable caches" selected.

Even if you start bypassing service workers, the Cache API is still accessible from the main window.  Its basically just another store like IDB.

This option should probably just clarify its talking about the http cache, if anything.

IMO this bug should be marked INVALID.
Also consider the shift-ctrl-r bypasses service worker interception per the spec, but does not disable caches.match() in any way.
Whiteboard: [btpp-fix-now] → [btpp-fix-now][DevRel:P2]
I feel very strongly that this should be WONTFIX.
I'm confused when I see the following:

    [✓] Disable Cache

Taking the label at its word, it appears to be broken: there's still a significant cache that is enabled and working.

We can resolve this two ways:

1. Meet the user's expectations. Naively, I'd expect ServiceWorkers to continue working, but either the cache object would not be available, or it would always miss.

2. Reword the label to be more specific. If we explicitly said something akin to "[✓] Disable Built-in Browser Cache," we could set the correct expectations for users.

Either would be acceptable, but I'd favor #1: from a developer's perspective, I'm looking for the ability to quickly simulate what loading my site is like on a completely fresh profile with an empty cache. If we go with #2, I still don't have an easy way to accomplish the task I'm *actually* trying to do, but at least I won't think Firefox is broken.
(In reply to Dan Callahan [:callahad] from comment #8)
> I'm confused when I see the following:
> 
>     [✓] Disable Cache
> 
> Taking the label at its word, it appears to be broken: there's still a
> significant cache that is enabled and working.

Cache API is more like IDB than http cache.  At one point it was even called FetchStore, not Cache.  See bug 940273 comment 10.  Please don't get hung up on the name.

> 1. Meet the user's expectations. Naively, I'd expect ServiceWorkers to
> continue working, but either the cache object would not be available, or it
> would always miss.

I can tell you this is absolutely not what service worker devs expect or want.  Because I have fixed bugs written by devs asking why service workers broke when they used an addon to "disable http cache".

> 2. Reword the label to be more specific. If we explicitly said something
> akin to "[✓] Disable Built-in Browser Cache," we could set the correct
> expectations for users.

This is really talking about the http cache.  It probably makes sense to be specific there.

> Either would be acceptable, but I'd favor #1: from a developer's
> perspective, I'm looking for the ability to quickly simulate what loading my
> site is like on a completely fresh profile with an empty cache. If we go
> with #2, I still don't have an easy way to accomplish the task I'm
> *actually* trying to do, but at least I won't think Firefox is broken.

Ok, how are you clearing cookies, IDB, local storage in this case?  Does "disable cache" reset that state as well?  I don't think it does.

What you really want is the "open this page in a fresh profile".  People on chrome use their incognito for that.  Our private browsing is not quite equivalent since we block storage APIs in PB mode.  The new multiple container code is probably our best bet for implementing something like this.  You get a new principal for each container isolating all storage, etc.  You could then add a "load page in new container" button.

But I feel very strongly disabling the http cache should not break random other storage APIs.

I would also consider a "disable service worker interception while devtools is open" option.  That seems like it might also meet what you are asking for.
Rewording to "Disable HTTP Cache" sounds like a great solution to me.
(In reply to Dan Callahan [:callahad] from comment #10)
> Rewording to "Disable HTTP Cache" sounds like a great solution to me.

Alright, renaming bug to match
Summary: "Disable Cache" has no effect on service worker caches → Rename "Disable Cache" option to "Disable HTTP Cache"
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Comment on attachment 8749707 [details]
MozReview Request: Bug 1253018 - Rename cache option to mention HTTP. r=bgrins

https://reviewboard.mozilla.org/r/51105/#review47783

Works for me, thanks
Attachment #8749707 - Flags: review?(bgrinstead) → review+
https://hg.mozilla.org/mozilla-central/rev/794c7ee92f48
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
I've documented the naming change here:

https://developer.mozilla.org/en-US/docs/Tools/Settings#Advanced_settings

And also added a note to the Fx 49 release notes:

https://developer.mozilla.org/en-US/Firefox/Releases/49#Developer_Tools 

Let me know if that looks ok. Thanks!
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: