Skip to content

Deferred fetching #1647

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more cleanup and a bug fix
  • Loading branch information
annevk committed May 22, 2025
commit 495bed61fae75d880cd49b0d99d4caadb15abc3c
20 changes: 12 additions & 8 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4484,15 +4484,16 @@ the response. [[!HTTP-CACHING]]
dispatch and processing of HTTP/1 fetches. [[!RFC9218]]

<li>
<p>If <var>request</var> is a <a>subresource request</a>, then:
<p>If <var>request</var> is a <a>subresource request</a>:

<ol>
<li><p>Let <var>record</var> be a new <a for="fetch group">fetch record</a> whose
<a for="fetch record">request</a> is <var>request</var> and <a for="fetch record">controller</a>
is <var>fetchParams</var>'s <a for="fetch params">controller</a>.

<li><p>Append <var>record</var> to <var>request</var>'s <a for=request>client</a>'s
<a for=fetch>fetch group</a> list of <a for="fetch group">fetch records</a>.
<li><p><a for=list>Append</a> <var>record</var> to <var>request</var>'s
<a for=request>client</a>'s <a for="environment settings object">fetch group</a>'s
<a for="fetch group">fetch records</a>.
</ol>

<li><p>Run <a>main fetch</a> given <var>fetchParams</var>.
Expand Down Expand Up @@ -5678,7 +5679,7 @@ run these steps:
<li><p>Let <var>inflightKeepaliveBytes</var> be 0.

<li><p>Let <var>group</var> be <var>httpRequest</var>'s <a for=request>client</a>'s
<a>fetch group</a>.
<a for="environment settings object">fetch group</a>.

<li><p>Let <var>inflightRecords</var> be the set of <a for="fetch group">fetch records</a> in
<var>group</var> whose <a for="fetch record">request</a>'s <a for=request>keepalive</a> is true
Expand Down Expand Up @@ -6810,7 +6811,8 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
<h3 id=deferred-fetch>Deferred fetching</h3>

<p>Deferred fetching allows callers to request that a fetch is invoked at the latest possible
moment, i.e., when a <a>fetch group</a> is <a for="fetch group">terminated</a>, or after a timeout.
moment, i.e., when a <a for=/>fetch group</a> is <a for="fetch group">terminated</a>, or after a
timeout.

<p>The <dfn>deferred fetch task source</dfn> is a <a>task source</a> used to update the result of a
deferred fetch. User agents must prioritize tasks in this <a>task source</a> before other task
Expand All @@ -6836,7 +6838,8 @@ which is an algorithm that takes no arguments:
<var>onActivatedWithoutTermination</var>.

<li><p><a for=list>Append</a> <var>deferredRecord</var> to <var>request</var>'s
<a for=request>client</a>'s <a>fetch group</a>'s <a for="fetch group">deferred fetch records</a>.
<a for=request>client</a>'s <a for="environment settings object">fetch group</a>'s
<a for="fetch group">deferred fetch records</a>.

<li>
<p>If <var>activateAfter</var> is non-null, then run the following steps <a>in parallel</a>:
Expand Down Expand Up @@ -6886,7 +6889,7 @@ which is an algorithm that takes no arguments:
</div>

<div algorithm>
<p>To <dfn>process deferred fetches</dfn> given a <a>fetch group</a> <var>fetchGroup</var>:
<p>To <dfn>process deferred fetches</dfn> given a <a for=/>fetch group</a> <var>fetchGroup</var>:

<ol>
<li><p><a for=list>For each</a> <a for="fetch group">deferred fetch record</a>
Expand Down Expand Up @@ -7137,7 +7140,8 @@ fetchLater("https://a.example.com", {body: a_6kb_body});

<li>
<p><a for=list>For each</a> <a>deferred fetch record</a> <var>deferredRecord</var> of
<var>navigable</var>'s <a for=navigable>active document</a>'s <a>fetch group</a>'s
<var>navigable</var>'s <a for=navigable>active document</a>'s <a>relevant settings object</a>'s
<a for="environment settings object">fetch group</a>'s
<a for="fetch group">deferred fetch records</a>:

<ol>
Expand Down