title: PWA service worker fetch not working properly
body: <p>I'm currently working on a PWA using the Flask webframe.
  Everything seems to work well until the fetch eventlistener.
  I wrote my fetch interception code like this and I don't think it's wrong.</p>
  <pre><code>self.addEventListener('fetch', (event) =&gt;{
  console.log(&quot;[From Service Worker]&quot;, event)
  event.respondWith(
      caches.match(event.request).then(cacheRes=&gt;{
          return cacheRes || fetch(event.request)
      })
    )}
  )
  </code></pre>
  <p>But when I check the console, only one fetch event is showing in it. In the network tag, it also shows that it's fetching the files from network, not from the service worker.
  I checked stackoverflow questions and noticed that it might be the scoping problem, but I the output shows its scope is <a href="http://127.0.0.1:5000/" rel="nofollow noreferrer">http://127.0.0.1:5000/</a>, the root directory.
  What's more, if I refresh the page with the DevTools off, when I check the console after refreshing, all the fetches are showing there like what it should be. But when I tried to refresh it with the tool on, the fetches were gone again.
  Why is this happening?</p>