-
Notifications
You must be signed in to change notification settings - Fork 0
/
workbox-config.js
68 lines (68 loc) · 1.44 KB
/
workbox-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
59
60
61
62
63
64
65
66
67
68
exports.workboxConfig = {
globDirectory: ".",
globPatterns: [
"./src/*.js",
"./src/lib/*.js"
],
swDest: "sw.js",
runtimeCaching: [
{
urlPattern: /\/static\//,
handler: 'CacheFirst',
options: {
cacheName: 'static-files'
}
},
{
urlPattern: /node_modules\//,
handler: 'CacheFirst',
options: {
cacheName: 'node-modules'
}
},
{
urlPattern: /\src\/apps\//,
handler: 'NetworkFirst',
options: {
cacheName: 'klog-apps'
}
},
{
urlPattern: /^https:\/\/storage\.krrr\.party\/storage\/klog-avatar\/.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'storage-avatar',
expiration: {
maxEntries: 30
}
}
},
{
urlPattern: /https:\/\/storage\.krrr\.party\/storage\/klog2\/.*\?Magic\/1\/.*/,
handler: 'CacheFirst',
options: {
cacheName: 'storage-thumbnail',
expiration: {
maxEntries: 30
}
}
},
{
urlPattern: /https:\/\/storage\.krrr\.party\/storage\/klog2\/.*\?Magic\/6/,
handler: 'CacheFirst',
options: {
cacheName: 'storage-placeholder'
}
},
{
urlPattern: /https:\/\/us\.leancloud\.cn\/1\.1\/classes\.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'leancloud-data',
expiration: {
maxEntries: 20
}
}
}
]
};