Modification site web

This commit is contained in:
Guillaume-Sanchez
2026-06-29 23:44:32 +02:00
parent 27f53835c2
commit ae80490684
13 changed files with 1357 additions and 750 deletions
+7 -9
View File
@@ -1,12 +1,10 @@
const CACHE = 'safeaccess-v1';
const ASSETS = ['/', '/index.html', '/manifest.json'];
const CACHE_NAME = 'cyberus-cache-v3';
const urlsToCache = ['./', './index.html', './manifest.json'];
self.addEventListener('install', e => {
e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS)));
self.addEventListener('install', event => {
event.waitUntil(caches.open(CACHE_NAME).then(cache => cache.addAll(urlsToCache)));
});
self.addEventListener('fetch', e => {
e.respondWith(
caches.match(e.request).then(r => r || fetch(e.request)).catch(() => caches.match('/index.html'))
);
});
self.addEventListener('fetch', event => {
event.respondWith(caches.match(event.request).then(response => response || fetch(event.request)));
});