This commit is contained in:
N0chteil 2022-01-07 17:40:12 +01:00
parent 1f507900b5
commit fc87a2fd6e
39 changed files with 4500 additions and 3275 deletions

View file

@ -2,39 +2,40 @@ module.exports = {
globDirectory: 'src/renderer/',
swDest: 'src/renderer/sw.js',
// Define runtime caching rules.
runtimeCaching: [{
// Match any request that ends with .png, .jpg, .jpeg or .svg.
urlPattern: /\.(?:png|jpg|jpeg|svg|webp)$/,
runtimeCaching: [
{
// Match any request that ends with .png, .jpg, .jpeg or .svg.
urlPattern: /\.(?:png|jpg|jpeg|svg|webp)$/,
// Apply a cache-first strategy.
handler: 'CacheFirst',
// Apply a cache-first strategy.
handler: 'CacheFirst',
options: {
// Use a custom cache name.
cacheName: 'imageinternet',
// Only cache 10 images.
options: {
// Use a custom cache name.
cacheName: 'imageinternet'
// Only cache 10 images.
}
},
},
{
urlPattern: /https:\/\/amp-api.music.apple.com\/v1\//,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'amp-api',
cacheableResponse: {
statuses: [0, 200],
},
},
statuses: [0, 200]
}
}
},
{
urlPattern: /https:\/\/is[0-9]-ssl\.mzstatic\.com\/image+/,
handler: "CacheFirst",
handler: 'CacheFirst'
},
{
urlPattern: /^https:\/\/store-\d{3}\.blobstore\.apple\.com\/.{65}\/image+/,
handler: "CacheFirst",
},
urlPattern:
/^https:\/\/store-\d{3}\.blobstore\.apple\.com\/.{65}\/image+/,
handler: 'CacheFirst'
}
],
ignoreURLParametersMatching: [
/^utm_/,
@ -44,6 +45,6 @@ module.exports = {
/^X-Amz-SignedHeaders/,
/^X-Amz-Expires/,
/^X-Amz-Credential/,
/^X-Amz-Signature/,
/^X-Amz-Signature/
]
};