Switch useCache to an enum
Closed this issue · 11 comments
We're worried about fetch all importScripts on every navigation. It sounds really heavy and a waste of bandwidth.
New proposal. useCache values:
- "never"
- "imports"
- "all"
It's a bit late in the day, but we all think this is a much safer change.
Gecko bug to avoid shipping boolean useCache: https://bugzilla.mozilla.org/show_bug.cgi?id=1353638
Gecko bug to switch to enum: https://bugzilla.mozilla.org/show_bug.cgi?id=1353636
I'm worried it isn't clear that useCache applies to updates, so I'm going to rename it updateViaCache. Objections welcome.
Service worker spec PR #1107
Just to clarify, is this also doing FB's request to bypass cache on register? The new name just made me wonder.
Nah, I haven't added that. But you're right, the naming makes even more sense considering that.
PR: #1107
SW change: c92c148. (merged)
HTML change: whatwg/html@b5fcec0. (merged)
Tests: web-platform-tests/wpt#5515. (underway)
We're confused that the service worker spec and the HTML spec seem to have contradicting definitions of updateViaCache in HTMLLinkElement.
(SW spec)
partial interface HTMLLinkElement {
...
[CEReactions] attribute ServiceWorkerUpdateViaCache updateViaCache;
};
(HTML spec)
interface HTMLLinkElement : HTMLElement {
...
[CEReactions] attribute DOMString updateViaCache;
};
It seems the HTMLLinkElement extension in the service worker spec is not needed since the HTML spec has it.
Ahh yes, we need to remove the one from the service worker spec. The HTML spec is the correct one.
Yes, it's being addressed in #1110 (comment).
Tests landed web-platform-tests/wpt#5515