PawMatchAI / service-worker.js
DawnC's picture
Update service-worker.js
e9b92bb
raw
history blame
588 Bytes
const CACHE_NAME = 'pawmatch-v1';
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll([
'./',
'./manifest.json',
'./assets/icon-192.png',
'./assets/icon-512.png'
]);
})
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request)
.then((response) => response || fetch(event.request))
.catch(() => caches.match('./'))
);
});