-
Notifications
You must be signed in to change notification settings - Fork 349
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
base: main
Are you sure you want to change the base?
Update HTTPFetch algorithm to support new SW Handle Fetch returns #1832
Conversation
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.
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! |
<var>serviceWorkerStartTime</var>. | ||
<li><p>Set <var>fetchParams</var>'s <a for="fetch params">timing info</a>'s | ||
<a for="fetch timing info">service worker timing info</a> to | ||
<var>response</var>'s <a for="response">service worker timing info</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"2.2.6. Responses" should be updated to have associated service worker timing info
?
<li><p>Set <var>fetchParams</var>'s <a for="fetch params">timing info</a>'s | ||
<a for="fetch timing info">final service worker start time</a> to | ||
<var>serviceWorkerStartTime</var>. | ||
<li><p>Set <var>fetchParams</var>'s <a for="fetch params">timing info</a>'s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a blocker but resource-timing may not not have a trivial way to know response
, right? I just wondered why we need to copy the timing info.
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 theresponse
type (or null, if the ServiceWorker couldn't handle the fetch and need to fallback to the network request). However, we have changed thehandle fetch
step to also returnservice 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 ofhandle 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