Add PWA support (I think)

This commit is contained in:
2026-04-16 23:57:42 +02:00
parent a7541b322b
commit ca25cdd924
3 changed files with 31 additions and 0 deletions

13
static/sw.js Normal file
View 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))
);
});