forked from berenjian/Salav.at
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sw-precache-config.js
44 lines (44 loc) · 959 Bytes
/
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
module.exports = {
// https://googlechromelabs.github.io/sw-toolbox/api.html
debug: false,
staticFileGlobs: [
'manifest.json',
"js/**/*",
"image/**/*",
"font/**/*"
],
runtimeCaching: [
// https://github.com/GoogleChromeLabs/sw-precache#runtimecaching-arrayobject
// https://googlechromelabs.github.io/sw-toolbox/api.html#handlers
{
urlPattern: /\/@webcomponents\/webcomponentsjs\//,
handler: 'fastest',
options: {
cache: {
name: 'webcomponentsjs',
maxEntries: 10,
}
}
},
{
urlPattern: /^https:\/\/polyfill.io\//,
handler: 'cacheFirst',
options: {
cache: {
name: 'polyfill',
maxEntries: 2,
}
}
},
{
urlPattern: /^https:\/\/api.salav.at\//,
handler: 'fastest',
options: {
cache: {
name: 'api',
maxEntries: 10,
}
}
}
]
};