title: Service worker: Fetch event listener only works after page reload
body: <p>I have added a service worker to my page with the code below. It works well once the page has been reloaded and the worker already installed. But does not seem to catch any fetch events before the page is reloaded after I have seen the <em>'SW INSTALL'</em> log.</p>
  
  <p><strong><em>app.js</em></strong></p>
  
  <pre><code>navigator.serviceWorker.register('/worker.js').then((registration) =&gt;
  {
      console.log('ServiceWorker registration successful with scope: ', 
  registration.scope);
  }, (err) =&gt;
  {
      console.log('ServiceWorker registration failed: ', err);
  });
  </code></pre>
  
  <p><strong><em>worker.js</em></strong></p>
  
  <pre><code>self.addEventListener('install', function (event)
   {
      console.log("SW INSTALL");
   });
  
  self.addEventListener('fetch', function (event)
  {
      console.log("FETCHING", event);
      event.respondWith(
              caches.match(event.request)
                      .then(function (response, err)
                              {
                                  // Cache hit - return response
                                  if (response)
                                  {
                                      console.log("FOUND", response, err);
                                      return response;
                                  }
                                  console.log("MISSED", event.request.mode);
                                  return fetch(event.request)
                              }
                      )
      );
  });
  </code></pre>