Cache: server actions from client
Answered
West African Crocodile posted this in #help-forum
West African CrocodileOP
Hi everyone. I like to use server actions in my Next.js projects, but now with version 15, I don't know how to cache data from client components using server actions. In version 14, I simply used unstable_cache. Can someone guide me?. Note: I don't want to use React Query and I think dynamicIO (experimental feature) only works for server.
Answered by B33fb0n3
you can still use unstable_cache. There wasn't any change. In the newer versions you can also ["use cache"](https://nextjs.org/docs/app/api-reference/directives/use-cache) to cache stuff. However
unstable_cache
is waaay more stable than use cache
. So I suggest you should use unstable_cache3 Replies
you can still use unstable_cache. There wasn't any change. In the newer versions you can also ["use cache"](https://nextjs.org/docs/app/api-reference/directives/use-cache) to cache stuff. However
unstable_cache
is waaay more stable than use cache
. So I suggest you should use unstable_cacheAnswer
West African CrocodileOP
Oh, thanks so much! I thought that I couldn't use it, but it was a misunderstanding of the documentation: https://nextjs.org/docs/app/api-reference/functions/unstable_cache
sure thing