What a mess
This commit is contained in:
19
pwa/public/sw.js
Normal file
19
pwa/public/sw.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const CACHE_NAME = 'echoes-of-the-ash-v1';
|
||||
const urlsToCache = [
|
||||
'/',
|
||||
'/index.html'
|
||||
];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME)
|
||||
.then((cache) => cache.addAll(urlsToCache))
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
event.respondWith(
|
||||
caches.match(event.request)
|
||||
.then((response) => response || fetch(event.request))
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user