New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useAsyncData not cache #15727
Comments
That's right, useAsyncData does not cache by default. You can implement your own cache if you would like. |
Thanks |
@danielroe Could you show in what place and when did they decide to change it? |
|
How to provide the caching mechanism then? For the static site, if on client-side navigation, the cache is not being fetched, the site breaks and starts throwing error as the fetch failed. Any other options? or examples to implement custom cache (as @danielroe mentioned)? |
I think it can be provided via useSWRV + $fetch in theory |
It might look smth like this |
Environment
Nuxi 3.0.0 09:55:06
09:55:07
RootDir: /app 09:55:07
Nuxt project info: 09:55:07
Linux
v18.12.1
3.0.0
1.0.0
yarn@1.22.19
vite
app
,typescript
,runtimeConfig
,build
,modules
,dayjs
@nuxtjs/tailwindcss@6.1.3
,@nathanchase/nuxt-dayjs-module@1.0.11
,@nuxt/image-edge@1.0.0-27827328.bc9ddc0
-
Reproduction
<script setup> const { data:datanew, pending, refresh } = await useAsyncData('testDataNew', () => $fetch(`https://api.nuxtjs.dev/mountains`)) const callapinew = async () => { datanew.value = await useAsyncData('testDataNew', () => $fetch(`https://api.nuxtjs.dev/mountains`)) } </script>Describe the bug
AsyncData does not cache even if the key is present. Is AsyncData not caching anymore?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: