21 lines
504 B
JavaScript
21 lines
504 B
JavaScript
self.addEventListener('install', function(event) {
|
|
event.waitUntil(
|
|
caches.open('watermelon-movies-cache').then(function(cache) {
|
|
return cache.addAll([
|
|
'/',
|
|
'/index.html',
|
|
'/style.css',
|
|
'/icons/apple-touch-icon.png',
|
|
'/manifest.json'
|
|
]);
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener('fetch', function(event) {
|
|
event.respondWith(
|
|
caches.match(event.request).then(function(response) {
|
|
return response || fetch(event.request);
|
|
})
|
|
);
|
|
});
|