30 lines
637 B
JavaScript
30 lines
637 B
JavaScript
const cacheName = 'gottesdienste-v1.10';
|
|
const assets = [
|
|
'/',
|
|
'/static/app.css',
|
|
'/static/app.js',
|
|
'/static/gallery.css',
|
|
'/static/gallery.js',
|
|
'/static/audioplayer.css',
|
|
'/static/audioplayer.js',
|
|
'/icon/logo-192x192.png',
|
|
'/icon/logo-512x512.png',
|
|
'/custom_logo/logoB.png',
|
|
'/custom_logo/logoW.png'
|
|
];
|
|
|
|
self.addEventListener('install', e => {
|
|
e.waitUntil(
|
|
caches.open(cacheName).then(cache => {
|
|
return cache.addAll(assets);
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener('fetch', e => {
|
|
e.respondWith(
|
|
caches.match(e.request).then(response => {
|
|
return response || fetch(e.request);
|
|
})
|
|
);
|
|
}); |