38770-vm/sw.js
2026-02-25 23:26:27 +00:00

24 lines
467 B
JavaScript

const CACHE_NAME = 'uptime-v1';
const ASSETS = [
'/',
'/index.php',
'/assets/css/custom.css',
'/manifest.json'
];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(ASSETS);
})
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((response) => {
return response || fetch(event.request);
})
);
});