File size: 636 Bytes
a59a059
 
f687a18
 
 
 
 
 
 
 
a59a059
 
 
 
 
2c132c1
 
f687a18
 
 
 
2c132c1
a59a059
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
self.addEventListener('install', (event) => {
    event.waitUntil(
        caches.open('pawmatch-v1').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) => {
                return response || fetch(event.request);
            })
            .catch(() => {
                return caches.match('./');
            })
    );
});