Don't cache requests from SW in dev mode

This commit is contained in:
Lucas Verney 2018-11-29 16:35:21 +01:00
parent b786ba9f4e
commit b097387825

View File

@ -82,6 +82,10 @@ global.self.addEventListener('fetch', (event) => {
// For the other requests, try to match it in the cache, otherwise do a // For the other requests, try to match it in the cache, otherwise do a
// network call // network call
if (DEBUG) {
// Never match from cache in production
return;
}
const resource = global.caches.open(CACHE_NAME).then( const resource = global.caches.open(CACHE_NAME).then(
cache => cache.match(request).then( cache => cache.match(request).then(
(response) => { (response) => {