-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsw-precache-config.js
More file actions
41 lines (41 loc) · 854 Bytes
/
sw-precache-config.js
File metadata and controls
41 lines (41 loc) · 854 Bytes
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
module.exports = {
staticFileGlobs: [
'/manifest.json',
'/bower_components/webcomponentsjs/webcomponents-lite.min.js',
'/images/*'
],
navigateFallback: '/index.html',
navigateFallbackWhitelist: [/^(?!.*\.html$|\/data\/).*/],
runtimeCaching: [
{
urlPattern: /.*\.(png|jpg|gif|svg)/i,
handler: 'fastest',
options: {
cache: {
maxEntries: 200,
name: 'data-images-cache'
}
}
},
{
urlPattern: /\/data\/articles\/.*/,
handler: 'fastest',
options: {
cache: {
maxEntries: 100,
name: 'data-articles-cache'
}
}
},
{
urlPattern: /\/data\/.*json/,
handler: 'fastest',
options: {
cache: {
maxEntries: 10,
name: 'data-json-cache'
}
}
}
]
};