use cache Directive in Next.js 15 Canary Fails to Persist Cache and Deduplicate Requests Reliably #77391
Unanswered
TheKing0000
asked this question in
Help
Replies: 1 comment
-
Relevant discussion (with reproduction steps): #71896 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm using the new "use cache" directive in Next.js 15 (latest canary) along with cacheLife("hours") in my server functions. However, I've noticed that caching does not behave as expected:
Cached responses are frequently missed, resulting in repeated API calls for the same request.
Deduplication often fails — I see the same API call hitting my backend multiple times simultaneously.
This occurs even though all related server functions are using the "use cache" directive with a defined cache lifetime.
This behavior results in unnecessary API usage and breaks the expected cache efficiency.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions