Jay
Jay
NNuxt
Created by Jay on 10/29/2024 in #❓・help
Nuxt 2 PWA Caching Issue
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: {
cacheOptions: {
cacheId: '<npm package name> || nuxt',
directoryIndex: '/_nuxt/',
revision: undefined
},
cleanupOutdatedCaches: true,
runtimeCaching: [
{
urlPattern: '/^\/API_.*/',
strategyOptions: {
cacheName: 'api-cache',
},
}
]
},
}
pwa {
workbox: {
cacheOptions: {
cacheId: '<npm package name> || nuxt',
directoryIndex: '/_nuxt/',
revision: undefined
},
cleanupOutdatedCaches: true,
runtimeCaching: [
{
urlPattern: '/^\/API_.*/',
strategyOptions: {
cacheName: 'api-cache',
},
}
]
},
}
I have been trying to fix this issue for months now and I can't find a solution, I would really appreciate any hint 😔
9 replies