cannot invalidate cached data using getCachedData
Hey everyone! I'm having an issue with
Problem Description
I have a page component using
The page has functionality that updates the data, and I use
However, here's where it breaks:
It seems like when I navigate away and come back, Nuxt is serving the cached data from before the refresh occurred, completely ignoring that refreshNuxtData was called.
My Questions
What's the recommended way to handle this scenario?
Should the cache persist through navigation changes even after explicit refresh calls?
useLazyFetch caching behavior in Nuxt 3 and could use some help figuring out the best solution.Problem Description
I have a page component using
useLazyFetch with a specific cache key:The page has functionality that updates the data, and I use
refreshNuxtData(CacheKeys.inbox) to refresh the cache. This works perfectly while I stay on the same page.However, here's where it breaks:
- User views page with data
- User triggers an update (data gets modified in backend)
- I call refreshNuxtData(CacheKeys.inbox) - works correctly, shows fresh data
- User navigates to different page
- User navigates back to original page
It seems like when I navigate away and come back, Nuxt is serving the cached data from before the refresh occurred, completely ignoring that refreshNuxtData was called.
My Questions
What's the recommended way to handle this scenario?
Should the cache persist through navigation changes even after explicit refresh calls?
