Re: [whatwg/fetch] Add Stale While Revalidate Handling (#853)

If we'd re-route the async revalidation requests through "HTTP fetch", that means they go again through SW, preflight and CORS checks before properly handling redirects.

Seems to me that making sure these requests don't go through SW *again* would be fine, so setting the SW mode to "none" probably makes sense.

Regarding preflights, if a preflight was triggered during the initial request, but didn't have `Access-Control-Max-Age` header, this will trigger a preflight request *again*. That doesn't seem ideal :/

Repeating the CORS check OTOH seems necessary, as the response's CORS headers may have changed between the stale cached response and the shiny new one.

Does that make sense? If so, seems like we'd need both SW mode as "none" as well as another flag that bypasses preflights in this particular case where we're repeating a request that was just triggered and didn't fail the preflight last time around.

/cc @jakearchibald and @yutakahirano for their opinions

-- 
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/pull/853#issuecomment-458227232

Received on Monday, 28 January 2019 17:36:41 UTC