use cache, use cache: private can access runtime request APIs like cookies(), headers(), and searchParams directly inside the cached function.<Link prefetch={true}>, private cached content can be runtime prefetched — fetched ahead of navigation using the user's real session data.1async function getRecommendations(productId: string) {2'use cache: private';3cacheTag(`recommendations-${productId}`);4cacheLife({ stale: 60 });56// Can call cookies() INSIDE the cached function!7const sessionId = (await cookies()).get('session-id')?.value || 'guest';89return getPersonalizedRecommendations(productId, sessionId);10}
use cache: private to enable runtime prefetching. The content is still dynamic, but it's prefetched
when the static content of the page is also prefetched.use cache: private, meaning their recommendations will be loaded after navigation.use cache directive. use cache: private is currently experimental.


