-
Notifications
You must be signed in to change notification settings - Fork 118
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
SXG loading and service worker integration #409
Comments
One possibility (which @wanderview also mentions at w3c/resource-hints#78 (comment) for prefetch) could be to tie the signed exchange to the request's client, so that fetch(event.request) goes to the signed exchange by default, and you can construct a Request with a null |
Could we make Request cache value of "default" mean include checking the signed exchange by default and the "reload"/"nocache" would bypass it? |
I intend that If there's something in the algorithms that contradicts this, let me know so I can correct it (or realize that my intent is wrong, which is always possible). I think we talked about ways to make |
Thanks, that's good to know! Actually after writing that comment I saw the request's "signed exchange" defined and then wondered why it wouldn't be used but didn't want to triple post :) I think the current Overview wording may be confusing... I'd suggest clarifying that respondWith(event.request) just works (it reads as if you must clone() and set the cache mode). I think I can see why having the same behavior for I'm also wondering now about the suggestion to set the cache mode to get the SXG content after cloning. Wouldn't just cloning without changing the cache mode work? |
The overview says, "If [a Service Worker] needs to know that signed exchange content is available for the request it’s handling, it has two options:" before saying to use the cache mode, and I think you didn't read that before jumping to the text about |
I'm raising this issue as suggested by horo at #347 (comment)
The current spec has an Overview which explains service worker integration. I'm wondering whether some alternatives were considered and rejected.
I think this makes sense. My understanding is that if the request were to go to "network" (i.e., the service worker doesn't call respondWith()), the response would come from the signed exchange, so
preloadResponse
should be that response.This I'm not sure about. Historically
respondWIth(fetch(event.request))
is expected to have the same behavior as not callingrespondWith()
. Is it possible to arrange things such that fetch(event.request) gets the response from the signed exchange by default and you need to clone() request and set a flag to skip the signed exchange?The text was updated successfully, but these errors were encountered: