fetch
fetch copied to clipboard
Update HTTPFetch algorithm to support new SW Handle Fetch returns
This will update the HttpFetch algorithm, particularly the handling of the response for Service Worker fetch (handle fetch step). Currently, the response of handle fetch step is assumed to return the response type (or null, if the ServiceWorker couldn't handle the fetch and need to fallback to the network request). However, we have changed the handle fetch step to also return service worker timing info when the ServiceWorker static routing API used, so that the corresponding timing information are correctly exposed when the ServiceWorker could not handle the fetch. To support this new return type, we need to update the handling of the response of handle fetch.
To expose the Service Worker Timing Info to the resource timing API, we also associate them to the Fetch Timing Info so that it could be later referenced.
- [ ] At least two implementers are interested (and none opposed):
- Chromium is proposing the change
- Waiting for reponse from other vendors (will update once we get support).
- [ ] Tests are written and can be reviewed and commented upon at:
- https://wpt.fyi/results/service-workers/service-worker/tentative/static-router?label=experimental&label=master&aligned
- [ ] Implementation bugs are filed:
- Chromium: https://crbug.com/41496865
- Gecko: https://github.com/mozilla/standards-positions/issues/1031
- WebKit: https://github.com/WebKit/standards-positions/issues/354
- Deno (not for CORS changes): N/A
- [ ] MDN issue is filed: …
- [x] The top of this comment includes a clear commit message to use.
(See WHATWG Working Mode: Changes for more details.)
This PR is for the resource timing API changes of ServiceWorker static routing API. Since some of the criterias are not met yet, let me make this as draft.
Let me make this a PR and ask for opinions about this.
@yoshisatoyanagisawa Could you check if this make sense? Thanks!
@annevk Thanks for taking a look offline! I have rebased on top of recent change.
Could you publish the comments you made during our offline chat at TPAC last week? Thanks!
@quasi-mod I decided to take a pass at the formatting myself since it's your first contribution. While doing that I ended up fixing a couple of minor errors and also realized that the non-null check is redundant with the type checks. The result is a much cleaner diff. Could you please verify that all my changes were indeed editorial? (Note that I forced pushed to your branch to also rebase it so if you want to make further changes please be aware of that.)
I'd also like to hear back from @yoshisatoyanagisawa about the unresolved thread above.
@annevk Thank you for updating! I have reviewed the changes and seems to be OK.