blob: 14fb7fde53450b7ce3a9e9ccd8a8e81335f51bf7 [file] [log] [blame]
// Version: 1.0.5
var CACHE_NAME = 'all-v1';
var urlsToCache = [
'/',
'/css/styles.css',
'/img/logo.svg',
'/js/script.js',
'/concerts/nadal2020joves.json',
'/concerts/nadal2020nens.json',
];
self.addEventListener('install', event => {
self.skipWaiting();
event.waitUntil(
caches.open(CACHE_NAME).then(cache => {
return cache.addAll(urlsToCache);
})
);
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request).then(response => {
if (response) return response;
return fetch(event.request);
})
);
});