Is 'use cache' directive enabled in prod? #81792
Replies: 3 comments 2 replies
-
Recommended Way: Use cache() from next/cache
Why this works well: This enables response memoization based on parameters (page, userId). It works reliably in production on both custom servers and Vercel. It doesn’t rely on unstable experimental flags. Optional: Tagging + Revalidation
Then later, when you update data:
|
Beta Was this translation helpful? Give feedback.
-
Hi, yeah it is enabled, but it is a different type of caching, in-memory. Are you using the combined feature, When Note that all of this is still experimental though - and should be tested against the latest canary possible. |
Beta Was this translation helpful? Give feedback.
-
@icyJoseph I am using only the I tried |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I enabled the experimental useCache directive, which works as expected when running locally.
However, once deployed on Vercel, nothing is cached; data cache stats stay to 0.
Here is an example of how I use it:
Next version: 15.4.2-canary.6
Project URL: https://drumtabs.app
Am I missing something here ?
Beta Was this translation helpful? Give feedback.
All reactions