-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkbox-config.js
51 lines (50 loc) · 1.14 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
module.exports = {
cacheId: '11ststarterkit',
globDirectory: 'dist/',
globPatterns: ['**/*.{css,js,json}'],
swDest: 'dist/sw.js',
runtimeCaching: [
{
urlPattern: /(?:\/)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'html',
expiration: {
maxAgeSeconds: 60 * 60 * 24 * 7,
},
},
},
{
urlPattern: /^(https:\/\/rsms\.me\/inter\/).+(.css)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'inter-font-stylesheet',
},
},
{
urlPattern: /^(https:\/\/rsms\.me\/inter\/font-files\/)/,
handler: 'CacheFirst',
options: {
cacheName: 'inter-font-webfont',
cacheableResponse: {
statuses: [0, 200],
},
expiration: {
maxAgeSeconds: 60 * 60 * 24 * 365,
maxEntries: 30,
},
},
},
{
urlPattern: /\.(?:png|jpg|jpeg|gif|webp|svg|ico)$/,
handler: 'CacheFirst',
options: {
cacheName: 'images',
expiration: {
maxAgeSeconds: 30 * 24 * 60 * 60,
maxEntries: 30,
},
},
},
],
};