From 94f80fea060a3c06c913955b90cd41bb18c922fa Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 9 Feb 2018 21:23:41 +0530 Subject: Update sw.js --- sw.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'sw.js') diff --git a/sw.js b/sw.js index d924062..0323d45 100644 --- a/sw.js +++ b/sw.js @@ -24,20 +24,23 @@ return cache.addAll([ ]); +}) -.then(() => self.skipWaiting()); - }) - ) -}); +); -self.addEventListener('activate', event => { - event.waitUntil(self.clients.claim()); }); +self.addEventListener('fetch', function(event) { + +console.log(event.request.url); + +event.respondWith( + +caches.match(event.request).then(function(response) { + +return response || fetch(event.request); + +}) + +); -self.addEventListener('fetch', event => { - event.respondWith( - caches.match(event.request, {ignoreSearch:true}).then(response => { - return response || fetch(event.request); - }) - ); }); -- cgit v1.2.3