-
Notifications
You must be signed in to change notification settings - Fork 13
/
workbox-config.js
47 lines (44 loc) · 1.13 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
module.exports = {
globDirectory: "HTML/",
globPatterns: ["**/*.{html,svg,png,json,js,css,xml,ico,woff,txt,jpg}"],
swDest: "HTML/sw.js",
skipWaiting: true,
clientsClaim: true,
navigateFallback: "/HTML/index.html",
// cleanupOutdatedCaches: true,
runtimeCaching: [
// {
// urlPattern: "/",
// handler: "NetworkFirst",
// options: {
// networkTimeoutSeconds: 10,
// cacheName: "app-cache",
// expiration: {
// maxEntries: 5,
// maxAgeSeconds: 60,
// },
// // Configure background sync.
// backgroundSync: {
// name: "my-queue-name",
// options: {
// maxRetentionTime: 60 * 60,
// },
// },
// },
// },
{
// Match any request that ends with .png, .jpg, .jpeg or .svg.
urlPattern: /\.(?:png|jpg|jpeg|svg)$/,
// Apply a cache-first strategy.
handler: "CacheFirst",
options: {
// Use a custom cache name.
cacheName: "images",
// Only cache 10 images.
expiration: {
maxEntries: 20,
},
},
},
],
};