Re: [whatwg/fetch] Deferred fetching (PR #1647)

@noamr commented on this pull request.



> +   <a for=request>body</a>'s <a for=body>length</a>.
+  </ol>
+ </li>
+
+ <li><p><a for=list>For each</a> <a>deferred fetch record</a> <var>deferredRecord</var> in
+ <var>request</var>'s <a for=request>client</a>'s <a for=fetch>fetch group</a>'s
+ <a for="fetch group">deferred fetch records</a>: if <var>deferredRecord</var>'s
+ <a for="deferred fetch record">request</a>'s <a for=request>body</a> is not null and
+ <var>deferredRecord</var>'s <a for="deferred fetch record">request</a>'s <a for=request>URL</a>'s
+ <a for=url>origin</a> is <a>same origin</a> with <var>request</var>'s <a for=request>URL</a>'s
+ <a for=url>origin</a>, then increment <var>totalScheduledDeferredBytesForOrigin</var> by
+ <var>deferredRecord</var>'s <a for="deferred fetch record">request</a>'s <a for=request>body</a>'s
+ <a for=body>length</a>.
+
+ <li><p>If <var>totalScheduledDeferredBytesForOrigin</var> is greater than 64 kilobytes, then
+ throw a {{QuotaExceededError}}.

Regarding keepalive, I think this should be a bit different (also chatted about this with @yoavweiss):
Keepalive and fetchLater are mutually exclusive and so are there quotas. 
- Keepalive quota is global, fetchLater quota is per origin
- Keepalive is for requests that dispatch immediately
- Keepalive survives termination, fetchLater (usually) invokes at termination

So I think the solution would be that deferred fetches are *not* keepalive, and instead, they're simply not terminated when the fetch group is terminated, if they're already dispatched. I think the PR already does this but I'll correct it if it doesn't and add a note.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1647#discussion_r1233701285
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1647/review/1485675407@github.com>

Received on Monday, 19 June 2023 08:24:34 UTC