diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2018-02-09 21:18:41 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 21:18:41 +0530 |
commit | 393a7dfde86a269ebee1e200647e8b3a046d2968 (patch) | |
tree | adbf33d6454baae473bdec3c3bf7fb6c34d5b763 /sw.js | |
parent | c998d3b25002d982a61f540eb8a950837bf2ab73 (diff) |
Update sw.js
Diffstat (limited to 'sw.js')
-rw-r--r-- | sw.js | 31 |
1 files changed, 13 insertions, 18 deletions
@@ -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); + }) + ); }); |