Add PWA support (I think)
This commit is contained in:
13
static/sw.js
Normal file
13
static/sw.js
Normal file
@@ -0,0 +1,13 @@
|
||||
self.addEventListener('install', e => {
|
||||
e.waitUntil(
|
||||
caches.open('resendit-v1').then(cache => {
|
||||
return cache.addAll(['/', '/index.html', '/login.html', '/logo.png']);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', e => {
|
||||
e.respondWith(
|
||||
caches.match(e.request).then(response => response || fetch(e.request))
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user