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

dtapuska commented on this pull request.



> +         "<code>no-cache</code>".
+
+         <li><p>Set <var>revalidateRequest</var>'s
+         <a for=request>prevent no-cache cache-control header modification flag</a>.
+
+         <li><p>Set <var>revalidateRequest</var>'s <a for=request>service-workers mode</a> set to
+         "<code>none</code>".
+
+         <li>
+          <p><a>In parallel</a>, perform <a for=main>main fetch</a> using
+          <var>revalidateRequest</var>.
+
+          <p class=note>This fetch is only meant to update the state of the HTTP cache and the
+          response will be unused until another cache access. The stale response will be used as the
+          response to current request. This fetch is issued in the context of a client so if it goes
+          away the request will be terminated.

Yes Chrome's implementation covers all fetches with a client. Gecko's implementation does not have that requirement so it will be activated in more scenarios, albeit as @mayhemer points out some scenarios are limited because Gecko uses "no-store" policy for some of those fetches.

Chrome's implementation was done this way so outstanding SWR would be cancelled when a browsing context is destroyed. The Chrome networking team did not want SWR requests on going after a user has terminated the tab.



-- 
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#discussion_r280507662

Received on Thursday, 2 May 2019 16:52:12 UTC