aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw.js47
1 files changed, 30 insertions, 17 deletions
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'
+
+]);
+
+})
+
+);
+
});