Re: [whatwg/fetch] Specify restriction for requests with keepalive set (#679)

Based on what we discussed at TPAC, I update the proposal as following:

1. Introduce KeepaliveContext which keeps track of the inflight requests with keepalive set.
1. Each origin has its own KeepaliveContext.
1. Each browsing context has its associated KeepaliveContext.
1. If a browsing context is a [top-level browsing context](https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context), its KeepaliveContext is set to its origin's KeepaliveContext.
1. If a browsing context is a nested browsing context, its KeepaliveContext is set to its parent browsing context's KeepaliveContext.
1. A dedicated worker shares the KeepaliveContext with its responsible browsing context.
1. **All** service workers and shared workers share one KeepaliveContext.
1. A request has an associated KeepaliveContext. It is set to
   - the original request's KeepaliveContext for the service worker interception case, and
   - client's KeepaliveContext otherwise.
1. When a fetch group is terminated, for each request _r_ with keepalive set:
   1. Let _context_ be _r_'s associated KeepaliveContext.
   1. If the size of _context_ doesn't exceed a certain limit, then add _r_ to _context_.
   1. Otherwise, abort _r_.

Makes sense?


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/679#issuecomment-433827856

Received on Monday, 29 October 2018 08:38:05 UTC