diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2018-01-21 18:42:48 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-21 18:42:48 +0530 |
commit | 952292f7d4faa1c636369bd7cd96564c5238ab47 (patch) | |
tree | 77189ca19b494b99ca54b3a8253ac0e5e15610bd /sw.js | |
parent | 6e19fc7f9780103d5832b95f4ecc8e74be321b22 (diff) |
Update sw.js
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' + +]); + +}) + +); + }); |