-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsw-precache-config.js
58 lines (57 loc) · 1.19 KB
/
sw-precache-config.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
module.exports = {
staticFileGlobs: [
'/index.html',
'/manifest.json',
'/src/*.html',
'/bower_components/webcomponentsjs/webcomponents-lite.js',
'/images/phanui/**'
],
navigateFallback: '/index.html',
navigateFallbackWhitelist: [/^(?!.*\.html$|\/data\/).*/],
runtimeCaching: [
{
urlPattern: /\/bower_components\/.*/,
handler: 'networkFirst',
options: {
cache: {
maxAgeSeconds:60*60*24*10,
maxEntries: 400,
name: 'elements-cache'
}
}
},
{
urlPattern: /\/src\/.*/,
handler: 'networkFirst',
options: {
cache: {
maxAgeSeconds:60*60*24,
maxEntries: 50,
name: 'src-elements-cache'
}
}
},
{
urlPattern: /\/data\/.*/,
handler: 'cacheFirst',
options: {
cache: {
maxAgeSeconds:60*60*24*10,
maxEntries: 200,
name: 'data-cache'
}
}
},
{
urlPattern: /\/images\/.*/,
handler: 'cacheFirst',
options: {
cache: {
maxAgeSeconds:60*60*24*10,
maxEntries: 200,
name: 'images-cache'
}
}
}
]
};