-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should FetchEvent.request.cache reflect non-fetch browser cache controls? #875
Comments
We should add a note to fetch to set |
Or if the user has disabled the cache, etc. This is user configurable in Firefox. |
The exact value should really match the behavior. For example, our devtools option to bypass http cache actually does 'no-store'. Hitting refresh button without the devtools option set does 'no-cache'. |
If the user hits refresh we change how a |
@annevk both right? Hitting refresh changes the fetching of both the navigation fetch and subresources. |
Pre F2F notes: Don't think there's anything to discuss unless there are objections. Seems like we should move this to the fetch repo. |
F2F:
|
So I'm still wondering whether we should expose this difference through It's not at all clear to me what the right thing here is. |
This is largely the point of using a service worker, no? The user hits the refresh button triggering no-cache fetches. The SW then responds with data from the Cache API without consulting the server. Or synthesizes a response, etc. The user's request to check with the server is often ignored by design. If the user does a hard refresh (shift-ctrl-r) then SW is bypassed. The user's intent cannot be changed at this point. This is a SW intercept design choice, though. The exposed request.cache value is a minor point when you can return completely different responses. I see no reason to make browser cache overrides magical and hidden. |
I'm not sure whether @annevk's comment and @wanderview's comment are on the same page. To me, what matters in this issue is just to set request's cache mode to a right value for the given request context. E.g., set it to no-cache for refresh in general. That cache mode will be observed only when the request hits the network layer bypassing SW. (If the request hits the network layer and the dev set the optional request.cache, that should override whatever the default behavior.) For specifying what cache mode is used for refresh, etc., I guess we defer to fetch. But what's discussed in the f2f was that "Browsers do different things on refresh, that's ok". So, we may just close this issue? |
Let's think about an example scenario. A navigation to a main resource (N) that includes a
I guess @wanderview originally brought this question? - how to override the cache mode value (or not) and how to spec it? |
I would expect R to be
In gecko we report Personally I think I'm not sure where it is spec'd, but I think refresh and hard refresh should do something like:
|
I think the expected behavior for "refresh" and "hard refresh" and how to spec them (overriding the cache mode values) have not been decided. I want to bring this to f2f during this TPAC. /cc @annevk |
Dupe of #873? |
Yes. Resolution:
|
Also clarify the expected behavior of |
It's about setting a right cache mode value for various fetching instances. I'm not sure where to move this issue, but this isn't a SW V1 issue. |
Currently the Request.cache attribute reflects the request's RequestCache setting. The current specs are a bit vague on this point. Only
fetch()
actually sets this, but the browser can bypass the http cache for other reasons. For example, if a user presses the refresh button causing the page to reload with http cache revalidation, should the corresponding FetchEvent.request.cache be set tono-cache
.I believe we should reflect these browser cache settings on all FetchEvent's whether they come from
fetch()
or another source.The text was updated successfully, but these errors were encountered: