Skip to content

Update HTTPFetch algorithm to support new SW Handle Fetch returns #1832

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

quasi-mod
Copy link

@quasi-mod quasi-mod commented May 30, 2025

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.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

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.
@quasi-mod
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant