use cache, use cache: private can access runtime request APIs like cookies(), headers(), and searchParams directly inside the cached function.prefetch = 'allow-runtime' on the page and <Link prefetch={true}>, private cached content can be runtime prefetched — fetched ahead of navigation using the user's real session data.1export const prefetch = 'allow-runtime';23async function getRecommendations(productId: string) {4'use cache: private';5cacheTag(`recommendations-${productId}`);6cacheLife({ stale: 60 });78// Can call cookies() INSIDE the cached function!9const sessionId = (await cookies()).get('session-id')?.value || 'guest';1011return getPersonalizedRecommendations(productId, sessionId);12}
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.


