]>
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/vue.min.js', | |
13 | 'vendors/js-yaml.min.js', | |
14 | 'vendors/font-awesone.min.css', | |
15 | 'vendors/bulma.min.css', | |
16 | 'assets/logo.png', | |
17 | 'assets/favicon.png', | |
18 | 'webfonts/raleway/raleway-v14-latin-regular.woff', | |
19 | 'webfonts/raleway/raleway-v14-latin-regular.woff2', | |
20 | 'webfonts/lato/lato-v16-latin-regular.woff', | |
21 | 'webfonts/lato/lato-v16-latin-regular.woff2', | |
22 | 'webfonts/fa-brands-400.woff', | |
23 | 'webfonts/fa-brands-400.woff2', | |
24 | 'webfonts/fa-brands-400.svg', | |
25 | 'webfonts/fa-brands-400.ttf', | |
26 | 'webfonts/fa-brands-400.eot', | |
27 | 'webfonts/fa-regular-400.woff', | |
28 | 'webfonts/fa-regular-400.woff2', | |
29 | 'webfonts/fa-regular-400.svg', | |
30 | 'webfonts/fa-regular-400.ttf', | |
31 | 'webfonts/fa-regular-400.eot', | |
32 | 'webfonts/fa-solid-900.woff', | |
33 | 'webfonts/fa-solid-900.woff2', | |
34 | 'webfonts/fa-solid-900.svg', | |
35 | 'webfonts/fa-solid-900.ttf', | |
36 | 'webfonts/fa-solid-900.eot', | |
37 | ]) | |
38 | ) | |
39 | ) | |
40 | }) | |
41 | ||
42 | self.addEventListener('fetch', event => { | |
43 | event.respondWith( | |
44 | caches.match(event.request).then(response => { | |
45 | if (response) { | |
46 | return response; | |
47 | } | |
48 | return fetch(event.request); | |
49 | }) | |
50 | ); | |
51 | }); |