blob: 53519f30e807b1db71f427e34723b28572fd5c5f [file] [log] [blame]
// Version: 1.0.3
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);
})
);
});