Re: [whatwg/streams] Meta: add a service worker to the spec (#637)

domenic commented on this pull request.



> +  "https://resources.whatwg.org/commit-snapshot-shortcut-key.js",
+  "https://resources.whatwg.org/logo-streams.svg"
+];
+
+self.oninstall = e => {
+  e.waitUntil(caches.open(cacheKey).then(cache => cache.addAll(toCache)));
+};
+
+self.onfetch = e => {
+  if (e.request.method !== "GET") {
+    return;
+  }
+
+  e.respondWith(
+    // Since this is a Living Standard, it is imperative that you see the freshest content, so we use a
+    // network-then-cache strategy.

Great call, the spec is much faster now when throttled even to 2G.

-- 
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/streams/pull/637

Received on Friday, 30 December 2016 18:26:22 UTC