Handling cache with authentication #67634
-
Hey, I'm using AuthJS with Next.js 14, and I'm encountering an issue with Server Components opting out of caching when calling the auth() function (due to cookies, it seems). I tried moving the auth() function into the fetch function itself, but I'm still experiencing the same behavior. Is there any way to cache the session? How do you handle this issue? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You could use react's |
Beta Was this translation helpful? Give feedback.
-
Resolved: Using unstable_cache solves this issue. |
Beta Was this translation helpful? Give feedback.
Resolved: Using unstable_cache solves this issue.