Re: [whatwg/fetch] Allow service-workers mode to be set in fetch options (#492)

A concern is infinite loop detection and prevention.  To do that, we need to be able to associate the resulting fetch(es) with the source fetch.  The concern could be mitigated if the recursive fetch established an explicit link to the source/initiating fetch request at fetch() call time.

Otherwise you get into inference that depends on us reliably propagating the root cause through various async API calls.  And in the face of global state, that inference can fall down.  (For example, issuing a fetch in a setTimeout scheduled by a different, non-recursive fetch event.  For example, a SW that tried to aggregate requests by using setTimeout to trigger a flush after waiting "long enough".)  Since we expect SW's to potentially service a large number of fetch events, simpler approaches like a token bucket where we give the SW n recursive tokens every time it gets a non-recursive fetch event, a lot of wasteful recursion could happen before we stop.

-- 
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/492#issuecomment-291407928

Received on Tuesday, 4 April 2017 06:41:20 UTC