diff options
Diffstat (limited to 'sw.js')
-rw-r--r-- | sw.js | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -0,0 +1,18 @@ +// 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', + ]); + }) + ); +}); |