From 952292f7d4faa1c636369bd7cd96564c5238ab47 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 21 Jan 2018 18:42:48 +0530 Subject: Update sw.js --- sw.js | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'sw.js') diff --git a/sw.js b/sw.js index 8a4bd47..a7175db 100644 --- a/sw.js +++ b/sw.js @@ -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' + +]); + +}) + +); + }); -- cgit v1.2.3