Files
cyberusgate/app/sw.js
T
Guillaume-Sanchez 47dd7f4c4d Refonte total
2026-06-29 23:12:26 +02:00

13 lines
361 B
JavaScript

const CACHE = 'safeaccess-v1';
const ASSETS = ['/', '/index.html', '/manifest.json'];
self.addEventListener('install', e => {
e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS)));
});
self.addEventListener('fetch', e => {
e.respondWith(
caches.match(e.request).then(r => r || fetch(e.request)).catch(() => caches.match('/index.html'))
);
});