blob: 8a4bd47ddc8d3fc0f839fe90236882c8ecb52722 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// sw.js
self.addEventListener('install', e => {
e.waitUntil(
// after the service worker is installed,
// open a new cache
caches.open('my-pwa-cache').then(cache => {
// add all URLs of resources we want to cache
return cache.addAll([
'/',
'/index.html',
'/about.html',
'/images/doggo.jpg',
'/styles/main.min.css',
'/scripts/main.min.js',
]);
})
);
});
|