From b0973878259045270641fc10142949b05b450258 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Thu, 29 Nov 2018 16:35:21 +0100 Subject: [PATCH] Don't cache requests from SW in dev mode --- src/sw.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sw.js b/src/sw.js index b3c9820..83439cf 100644 --- a/src/sw.js +++ b/src/sw.js @@ -82,6 +82,10 @@ global.self.addEventListener('fetch', (event) => { // For the other requests, try to match it in the cache, otherwise do a // network call + if (DEBUG) { + // Never match from cache in production + return; + } const resource = global.caches.open(CACHE_NAME).then( cache => cache.match(request).then( (response) => {