Updated sw-precache

This commit is contained in:
silas 2018-10-31 11:10:50 +01:00
parent f4e477d03c
commit 173908e504

View File

@ -34,7 +34,11 @@ module.exports = {
], ],
runtimeCaching: [ runtimeCaching: [
{ {
urlPattern: /^https:\/\/((matomo\.silas\.link)|(www\.googletagmanager\.com)|(apis\.google\.com)|(.*\.googleusercontent\.com)|(.*\.google.com)|(cdn.jsdelivr.net)).*$/, urlPattern: /^https:\/\/((matomo\.silas\.link)|(www\.googletagmanager\.com)|(apis\.google\.com)|(.*\.googleusercontent\.com)|(.*\.google.com)).*$/,
handler: "networkOnly"
},
{
urlPattern: /^https:\/\/((cdn.jsdelivr.net)).*$/,
handler: "networkFirst" handler: "networkFirst"
}, },
{ {
@ -45,25 +49,18 @@ module.exports = {
{ {
urlPattern: /^.*\/cached\/.*$/, urlPattern: /^.*\/cached\/.*$/,
handler: "networkFirst" handler: "networkFirst"
// handler: "networkFirst"
}, },
// {
// urlPattern: /^.*\/img\/icons\/.*$/,
// handler: "networkFirst"
// },
{ {
urlPattern: /^.*\/(version)\/.*$/, urlPattern: /^.*\/(version)\/.*$/,
handler: "cacheFirst" handler: "cacheFirst"
}, },
{ {
urlPattern: /^https:\/\/((www\.codecogs\.com)|(latex\.codecogs\.com)).*$/, urlPattern: /^https:\/\/((www\.codecogs\.com)|(latex\.codecogs\.com)).*$/,
// handler: "cacheFirst"
handler: "networkOnly" handler: "networkOnly"
}, },
{ {
urlPattern: /^.*$/, urlPattern: /^.*$/,
handler: myHandler handler: myHandler
// handler: "networkFirst"
}], }],
maximumFileSizeToCacheInBytes: 14194304 maximumFileSizeToCacheInBytes: 14194304
}; };