diff options
Diffstat (limited to 'sw.js')
-rw-r--r-- | sw.js | 47 |
1 files changed, 30 insertions, 17 deletions
@@ -1,18 +1,31 @@ -// sw.js -self.addEventListener('install', e => { - e.waitUntil( - // after the service worker is installed, - // open a new cache - caches.open('my-pwa-cache').then(cache => { - // add all URLs of resources we want to cache - return cache.addAll([ - '/', - '/index.html', - '/about.html', - '/images/doggo.jpg', - '/styles/main.min.css', - '/scripts/main.min.js', - ]); - }) - ); +importScripts('/cache-polyfill.js'); + +self.addEventListener('install', function(e) { + +e.waitUntil( + +caches.open('navanchauhan').then(function(cache) { + +return cache.addAll([ + +'/', + +'/index.html', + +'/Contact.html', + +'/css/*', + +'/js/*', + +'/404.html', + +'/*.png' + +]); + +}) + +); + }); |