Re: [w3c/ServiceWorker] allow service worker produced resources to be marked as "cachable" (#962)

Using the firefox-sw-perf repo, you can verify that Chrome skips the service worker for existing tabs (but not when you create a new tab) when caching headers are set correctly by replacing the event listener in sw.js with this:

```
var sum = 0;
self.addEventListener("fetch", function(event) {
  console.log(sum);
  for (var i = 0; i < 10000000; i++) {
    sum++;
  }
  return;
});
```

For refreshes and `ctrl+l, enter`, only one sum is printed after loading the page. For new tabs, the sum is printed for every resource.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/962#issuecomment-264316575

Received on Thursday, 1 December 2016 22:34:28 UTC