-
Notifications
You must be signed in to change notification settings - Fork 6
/
sw-precache-config.js
38 lines (38 loc) · 1 KB
/
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
module.exports = {
// Files to be cached
// Excluding amp files
staticFileGlobs: [
'_site/css/**.css',
'_site/*/index.html',
'_site/assets/**.*',
'_site/scripts/**.js',
'_site/index.html',
'_site/manifest.json',
'_site/!{amp,amp/**/index.html}'
],
stripPrefix: '_site/',
verbose: true,
ignoreUrlParametersMatching: [/./],
maximumFileSizeToCacheInBytes: 2510200,
//Template file
templateFilePath: './scripts/service-worker.tmpl',
// Scripts to be imported
importScripts: ['./scripts/sw-offline-google-analytics.prod.v0.0.25.js'],
// CDN Files to be cached
runtimeCaching: [{
urlPattern: /^https:\/\/ajax\.googleapis\.com\/ajax\/libs/,
handler: 'networkFirst'
},
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/css/,
handler: 'networkFirst'
},
{
urlPattern: /^https:\/\/www\.gstatic\.com\/firebasejs/,
handler: 'networkFirst'
},
{
urlPattern: /^https:\/\/cdn\.firebase\.com\/libs\/angularfire/,
handler: 'networkFirst'
}]
};