-
Notifications
You must be signed in to change notification settings - Fork 1
/
workbox-config.ja.js
63 lines (63 loc) · 1.45 KB
/
workbox-config.ja.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
module.exports = {
"globDirectory": "public/ja",
"globPatterns": [
"**/*.html"
],
"swDest": process.env.NODE_ENV === "production" ? "public/ja/sw.js" : "static/ja/sw.js",
"clientsClaim": true,
"skipWaiting": true,
"maximumFileSizeToCacheInBytes": 5 * 1024 * 1024,
"runtimeCaching": [
{
urlPattern: new RegExp('^https://cdn.ampproject.org'),
handler: 'staleWhileRevalidate',
options: {
cacheName: 'amp-components',
cacheableResponse: {
statuses: [0, 200]
}
}
},
{
urlPattern: new RegExp('/(.+.html)?$'),
handler: 'networkFirst',
options: {
cacheName: 'page',
expiration: {
maxAgeSeconds: 60 * 60 * 24
}
}
},
{
urlPattern: new RegExp('\.(json|woff2?|ttf|eot|otf)'),
handler: 'cacheFirst',
options: {
cacheName: 'assets',
expiration: {
maxAgeSeconds: 60 * 60 * 24 * 14
}
}
},
{
urlPattern: new RegExp('\.(jpg|png)'),
handler: 'cacheFirst',
options: {
cacheName: 'img',
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 60 * 24 * 7
}
}
},
{
urlPattern: new RegExp('^https://[a-z0-9]+\.cloudfront\.net'),
handler: 'cacheFirst',
options: {
cacheName: 'cdn-contents',
expiration: {
maxAgeSeconds: 60 * 60 * 24 * 7
}
}
}
]
};