From 393a7dfde86a269ebee1e200647e8b3a046d2968 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 9 Feb 2018 21:18:41 +0530 Subject: Update sw.js --- sw.js | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'sw.js') diff --git a/sw.js b/sw.js index ce10713..d924062 100644 --- a/sw.js +++ b/sw.js @@ -20,29 +20,24 @@ return cache.addAll([ '/Contact.html', '/projects.html', -'/404.html', +'/404.html' ]); -}) - -); - +.then(() => self.skipWaiting()); + }) + ) }); -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('activate', event => { + event.waitUntil(self.clients.claim()); +}); +self.addEventListener('fetch', event => { + event.respondWith( + caches.match(event.request, {ignoreSearch:true}).then(response => { + return response || fetch(event.request); + }) + ); }); -- cgit v1.2.3