- aggiornamenti guida RIS, FAQ

- Editor HTML aggiunto CSS e Script
- Statistiche
- CRISBalanceBar
- Inizio Sync... (ma disattivato)
This commit is contained in:
Surya Paolo
2025-12-02 22:16:24 +01:00
parent 8b6a636a96
commit a51bc5a8a2
53 changed files with 8041 additions and 1177 deletions

View File

@@ -117,8 +117,62 @@ self.addEventListener('activate', (event) => {
);
})
);
self.clients.claim(); // SERVE? OPPURE NO ?
});
const USASYNC = false;
// PER ATTIVARE IL SYNC TOGLI L'AREA COMMENTATA DI 'FETCH' QUI SOTTO ....
/*
// Strategia fetch
self.addEventListener('fetch', (event) => {
const { request } = event;
const url = new URL(request.url);
// ============================================
// IMPORTANTE: NON cachare API /sync o /loadsite
// ============================================
if (url.pathname.includes('/api/') ||
url.pathname.includes('/sync') ||
url.pathname.includes('/loadsite')) {
// Lascia passare normalmente - IndexedDB gestisce cache
return;
}
// ============================================
// Cache Strategy per assets statici
// ============================================
if (request.method === 'GET') {
event.respondWith(
caches.match(request).then((cachedResponse) => {
if (cachedResponse) {
return cachedResponse;
}
return fetch(request).then((response) => {
// Non cachare se non è successo
if (!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// Clona e salva in cache
const responseToCache = response.clone();
caches.open(CACHE_NAME).then((cache) => {
cache.put(request, responseToCache);
});
return response;
}).catch(() => {
// Offline fallback
if (request.destination === 'document') {
return caches.match('/offline.html');
}
});
})
);
}
});
*/
console.log(
' [ VER-' +
VITE_APP_VERSION +