What problem does it solve?
Cache Components lets you co-locate data fetching, caching and rendering decisions inside React Server Components to deliver fast static shells with streaming content, reducing perceived load times and SSR costs.
Core Features & Use Cases
- Cache data with the 'use cache' directive on server components for granular, cross-user performance gains.
- Use cacheLife, cacheTag, updateTag, revalidateTag, and revalidatePath for precise invalidation and background updates.
- Compose pages with static shells plus dynamic Suspense-driven content for optimal balance of speed and freshness.
- Follow patterns for subshells, hierarchical caching, and multi-tenant scenarios to improve reuse and scalability.
Quick Start
Enable Cache Components in your Next.js project by turning on cacheComponents: true in next.config and begin annotating server components with 'use cache' to enable partial prerendering.