bde-liste/static/sw.js

22 lines
416 B
JavaScript
Raw Permalink Normal View History

2022-12-20 20:23:31 +00:00
var cacheName = 'o1m';
var filesToCache = [
'/',
'/index.html'
];
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open(cacheName).then(function(cache) {
return cache.addAll(filesToCache);
})
);
});
self.addEventListener('fetch', function(e) {
e.respondWith(
caches.match(e.request).then(function(response) {
return response || fetch(e.request);
})
);
});