Hello! I'm using the PWA module on my Nuxt 2 project. I'm running into an issue:
I have a list of events which I'm requesting through some internal API url and saving it in the vuex store.
When I use my PWA, it is not fetching latest data. The event list stays as it is once you have downloaded the PWA. How do I fix that?
My config currently looks like this:
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,
},
},
],
}
]
},
}
I have been trying to fix this issue for months now and I can't find a solution, I would really appreciate any hint 😔