You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using useAsyncData (or useLazyAsyncData) with a fixed key in a composable fetches data for every component it is used in. Expected behaviour would be that it only fetches the data once. That was the case with rc.11 (my last rc before release), but not with rc14/release. I can't see any documentation mentioning this or any breaking change referencing this behavior.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
@danielroe This is very confusing. This is not mentioned anywhere in the documentation as I can see. On the contrary, it seems that requests with the same key between different pages should not be repeated but should use a shared cache. But it is not so.
Is this a bug that will be fixed in the future or is it expected behavior now? This is important, because in rc11, when performing certain mutations, I had to manually call clearNuxtData to clear related cache.
In the Stable release, there is no need to clear the cache yourself, because when switching between pages, although the cached data exists for the requested key, it is not used.
So can I delete all cache cleanup operations? Will the behavior of the load change again in the future and return to the way it was in rc11? 😵
No, it was a deliberate change to remove caching behaviour by default. In future it is possible we might provide a way for users to opt-in to caching, but I am not expecting a breaking change.
Environment
Windows_NT
v16.15.0
3.0.0
1.0.0
yarn@1.22.18
vite
runtimeConfig
,modules
,css
@pinia/nuxt@0.4.6
,@vueuse/nuxt@9.6.0
,@nuxtjs/tailwindcss@6.1.3
-
Reproduction
https://stackblitz.com/edit/github-ugv5yg-sfrist (Stable)
https://stackblitz.com/edit/github-ugv5yg-ijhnxn (rc.11)
Describe the bug
Using
useAsyncData
(oruseLazyAsyncData
) with a fixed key in a composable fetches data for every component it is used in. Expected behaviour would be that it only fetches the data once. That was the case with rc.11 (my last rc before release), but not with rc14/release. I can't see any documentation mentioning this or any breaking change referencing this behavior.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: