-
Notifications
You must be signed in to change notification settings - Fork 0
/
sw.js
76 lines (74 loc) · 2.15 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
importScripts('workbox-sw.prod.v2.1.1.js');
/**
* DO NOT EDIT THE FILE MANIFEST ENTRY
*
* The method precache() does the following:
* 1. Cache URLs in the manifest to a local cache.
* 2. When a network request is made for any of these URLs the response
* will ALWAYS comes from the cache, NEVER the network.
* 3. When the service worker changes ONLY assets with a revision change are
* updated, old cache entries are left as is.
*
* By changing the file manifest manually, your users may end up not receiving
* new versions of files because the revision hasn't changed.
*
* Please use workbox-build or some other tool / approach to generate the file
* manifest which accounts for changes to local files and update the revision
* accordingly.
*/
const fileManifest = [
{
"url": "www/assets/css/default.css",
"revision": "ae4b6cc0a969922f68114dd8730929d7"
},
{
"url": "www/assets/css/docker.css",
"revision": "ba6b99adb94d1d745f762493617e69c7"
},
{
"url": "www/assets/css/spinner.css",
"revision": "863ea9521c159961567ad5918574b5ab"
},
{
"url": "www/assets/fonts/MaterialIcons-Regular.woff2",
"revision": "570eb83859dc23dd0eec423a49e147fe"
},
{
"url": "www/assets/img/logo.png",
"revision": "1431a5c03eb1271c6a3c4d7ea8264da1"
},
{
"url": "www/assets/img/searca-logo.png",
"revision": "958e4eb48d21376784c4640bfc6abb4b"
},
{
"url": "www/assets/img/searca-new.png",
"revision": "a3da8712e9c72b8d6239a563c17ed267"
},
{
"url": "www/assets/img/share.png",
"revision": "a2fe42e8edefe76e97ac11e99c69f265"
},
{
"url": "www/assets/js/exports.js",
"revision": "b6ef6c8b72c537383c727bd64eb992a6"
},
{
"url": "www/assets/js/shell.js",
"revision": "bd7daf5f19e8ac21bcfcae8861844057"
},
{
"url": "www/index.html",
"revision": "e6637f36bebebb15959ad2d179135de4"
},
{
"url": "www/pages/welcome.html",
"revision": "01b1fccb4eb253ed443cae6f18695176"
},
{
"url": "www/spec.html",
"revision": "12366a1aaa83c60e50efecfe54f664b1"
}
];
const workboxSW = new self.WorkboxSW({skipWaiting: true, clientsClaim: true});
workboxSW.precache(fileManifest);