forked from ciderapp/Cider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
workbox-config.js
49 lines (45 loc) · 1.3 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
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)$/,
// Apply a cache-first strategy.
handler: 'CacheFirst',
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],
},
},
},
{
urlPattern: /https:\/\/is[0-9]-ssl\.mzstatic\.com\/image+/,
handler: "CacheFirst",
},
{
urlPattern: /^https:\/\/store-\d{3}\.blobstore\.apple\.com\/.{65}\/image+/,
handler: "CacheFirst",
},
],
ignoreURLParametersMatching: [
/^utm_/,
/^fbclid$/,
/^X-Amz-Algorithm/,
/^X-Amz-Date/,
/^X-Amz-SignedHeaders/,
/^X-Amz-Expires/,
/^X-Amz-Credential/,
/^X-Amz-Signature/,
]
};