]>
Commit | Line | Data |
---|---|---|
1 | self.addEventListener('install', event => { | |
2 | event.waitUntil( | |
3 | caches | |
4 | .open('homer') | |
5 | .then(cache => | |
6 | cache.addAll([ | |
7 | '/', | |
8 | '/index.html', | |
9 | '/config.yml', | |
10 | '/app.css', | |
11 | '/app.js', | |
12 | '/vendors/js-yaml.min.js', | |
13 | '/assets/logo.png', | |
14 | 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css', | |
15 | 'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css', | |
16 | 'https://fonts.googleapis.com/css?family=Lato|Raleway&display=swap', | |
17 | 'https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js', | |
18 | ]) | |
19 | ) | |
20 | ) | |
21 | }) | |
22 | ||
23 | self.addEventListener('fetch', event => { | |
24 | event.respondWith( | |
25 | caches.match(event.request).then(response => { | |
26 | if (response) { | |
27 | return response; | |
28 | } | |
29 | return fetch(event.request); | |
30 | }) | |
31 | ); | |
32 | }); |