pwa {
workbox: {
config: {
debug: false,
},
// skipWaiting: false,
// clientsClaim: true,
/* cacheOptions: {
cacheId: '<npm package name> || nuxt',
directoryIndex: '/_nuxt/',
revision: undefined
}, */
cleanupOutdatedCaches: true,
runtimeCaching: [
{
/* eslint-disable */
urlPattern: '/api/.*',
handler: async ({request, event}) => {
event.waitUntil(caches.delete('api-cache'));
return fetch(request);
},
method: 'GET',
strategyOptions: {
cacheName: 'api-cache',
cacheExpiration: {
maxEntries: 50,
maxAgeSeconds: 300,
},
},
strategyPlugins: [
{
use: 'Expiration',
config: {
maxEntries: 10,
maxAgeSeconds: 300,
},
},
],
}
]
},
}
pwa {
workbox: {
config: {
debug: false,
},
// skipWaiting: false,
// clientsClaim: true,
/* cacheOptions: {
cacheId: '<npm package name> || nuxt',
directoryIndex: '/_nuxt/',
revision: undefined
}, */
cleanupOutdatedCaches: true,
runtimeCaching: [
{
/* eslint-disable */
urlPattern: '/api/.*',
handler: async ({request, event}) => {
event.waitUntil(caches.delete('api-cache'));
return fetch(request);
},
method: 'GET',
strategyOptions: {
cacheName: 'api-cache',
cacheExpiration: {
maxEntries: 50,
maxAgeSeconds: 300,
},
},
strategyPlugins: [
{
use: 'Expiration',
config: {
maxEntries: 10,
maxAgeSeconds: 300,
},
},
],
}
]
},
}