-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsw.js
31 lines (30 loc) · 821 Bytes
/
sw.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open('v2.0').then(function(cache) {
return cache.addAll([
'/',
'/manifest.json',
'/index.html',
'/css/main.css',
'/js/main.js',
'/img/logo.svg',
'/img/mask.jpg',
'/img/work-bg-white.jpg',
'/img/work-bg-teal.jpg',
'/img/work-bg-orange.jpg',
'/img/work-bg-yellow.jpg',
'https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400&family=Work+Sans:wght@300;400&display=swap',
]);
})
);
});
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request).then(function(response) {
if (response) {
return response;
}
return fetch(event.request);
})
)
});