What problem does it solve?
Cache Components enable co-located caching and streaming in Next.js apps, turning heavy, repeated data fetching into fast static shells with dynamic content flowing in via Suspense.
Core Features & Use Cases
- Co-located data caching with 'use cache' to produce static shells plus streaming content
- Granular invalidation using cacheTag(), updateTag(), and revalidateTag() for precise data freshness
- Flexible cache lifetimes via cacheLife() to distinguish static vs dynamic content
- Subshell and generateStaticParams workflows for reusable route shells and progressive rendering
- Proactive project automation: automatic activation when cacheComponents: true is detected
- Suspense boundaries to stream uncached or dynamic data
Quick Start
Enable Cache Components in a Next.js project by turning on cacheComponents: true in next.config and begin annotating components with 'use cache', cacheLife(), and related APIs to leverage static shells and streaming content.