2025-07-17 10:32:06 +01:00
|
|
|
const CACHE_NAME = 'ktvmanager-cache-v1';
|
|
|
|
|
const urlsToCache = [
|
|
|
|
|
'/',
|
|
|
|
|
'/static/styles.css',
|
|
|
|
|
'/static/favicon.ico',
|
|
|
|
|
'/static/favicon-96x96.png',
|
|
|
|
|
'/static/favicon.svg',
|
|
|
|
|
'/static/apple-touch-icon.png',
|
|
|
|
|
'/static/web-app-manifest-192x192.png',
|
|
|
|
|
'/static/web-app-manifest-512x512.png',
|
|
|
|
|
'/static/site.webmanifest'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
self.addEventListener('install', function(event) {
|
|
|
|
|
event.waitUntil(
|
|
|
|
|
caches.open(CACHE_NAME)
|
|
|
|
|
.then(function(cache) {
|
|
|
|
|
console.log('Opened cache');
|
|
|
|
|
return cache.addAll(urlsToCache);
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2025-07-15 10:37:34 +01:00
|
|
|
self.addEventListener('fetch', function(event) {
|
2025-07-17 10:32:06 +01:00
|
|
|
event.respondWith(
|
|
|
|
|
caches.match(event.request)
|
|
|
|
|
.then(function(response) {
|
|
|
|
|
if (response) {
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
return fetch(event.request);
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
);
|
2024-11-07 18:06:18 +00:00
|
|
|
});
|