Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
360 B
JavaScript
14 lines
360 B
JavaScript
const CACHE = 'omsorg-v1';
|
|
const STATIC = ['./app.css'];
|
|
|
|
self.addEventListener('install', e =>
|
|
e.waitUntil(caches.open(CACHE).then(c => c.addAll(STATIC)))
|
|
);
|
|
|
|
self.addEventListener('fetch', e => {
|
|
if (e.request.url.endsWith('.php') || e.request.method !== 'GET') return;
|
|
e.respondWith(
|
|
fetch(e.request).catch(() => caches.match(e.request))
|
|
);
|
|
});
|