Next.js Discord

Discord Forum

Is it redundant to use React cache on a function that already uses unstable_cache?

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
I am using Next.js 14

Is it redundant to use React's cache on a function that already utilizes unstable_cache? For instance, if multiple components invoke a function wrapped with unstable_cache within a single render, will it rely on the cache to prevent multiple executions of the function, thereby making React's cache unnecessary?

Also do you think using nextjs-better-unstable-cache package is a good idea?

0 Replies