unstable_cache question
Unanswered
Britannia Petite posted this in #help-forum
Britannia PetiteOP
Hi! Is unstable_cache designed to work on both server and client, or just server?
(I am aware it's unstable)
https://nextjs.org/docs/app/api-reference/functions/unstable_cache
(I am aware it's unstable)
https://nextjs.org/docs/app/api-reference/functions/unstable_cache
4 Replies
Britannia PetiteOP
Alright! do you know if they plan on integrating it into client components too? I understand there are choppy ways to cache data on the client, but would be convenient
@Britannia Petite Alright! do you know if they plan on integrating it into client components too? I understand there are choppy ways to cache data on the client, but would be convenient
no, unstable_cache is for caching data on the server for use across requests in different clients. not sure how caching on the client is supposed to look like
Siamese Crocodile
you could probably use a server action function, that uses unstable_cache instead though!
Just be aware that the client will trigger a HTTP request to the server behind the scenes, and the values will be cached across mulitple requests / multiple visitors
Just be aware that the client will trigger a HTTP request to the server behind the scenes, and the values will be cached across mulitple requests / multiple visitors