summaryrefslogtreecommitdiff
path: root/public/sw.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/sw.js')
-rw-r--r--public/sw.js50
1 files changed, 25 insertions, 25 deletions
diff --git a/public/sw.js b/public/sw.js
index e6a263d1..61bac97c 100644
--- a/public/sw.js
+++ b/public/sw.js
@@ -1,27 +1,27 @@
-// const cacheName = 'cache-v1'
-// const resourceToPrecache = [
-// '/',
-// 'index.html',
-// '/css/',
-// '/js/',
-// '/pages/',
-// '/fonts/'
-// ]
+const cacheName = 'cache-v1'
+const resourceToPrecache = [
+ '/',
+ 'index.html',
+ '/css/',
+ '/js/',
+ '/pages/',
+ '/fonts/'
+]
-// self.addEventListener('install', event => {
-// console.log("Service Worker: Installed");
-// event.waitUntil(
-// caches.open(cacheName)
-// .then(cache => {
-// return cache.addAll(resourceToPrecache)
-// })
-// )
-// })
+self.addEventListener('install', event => {
+ console.log("Service Worker: Installed");
+ event.waitUntil(
+ caches.open(cacheName)
+ .then(cache => {
+ return cache.addAll(resourceToPrecache)
+ })
+ )
+})
-// self.addEventListener('fetch', event => {
-// event.respondWith(catches.match(event.request)
-// .then(cachedResponse => {
-// return cachedResponse || fetch(event.request);
-// })
-// );
-// }); \ No newline at end of file
+self.addEventListener('fetch', event => {
+ event.respondWith(catches.match(event.request)
+ .then(cachedResponse => {
+ return cachedResponse || fetch(event.request);
+ })
+ );
+}); \ No newline at end of file