Docs
Caching
Overview
Learn about Caching mechanisms in Next.js for optimal performance and scalability.
Caching is a critical aspect of modern web applications, enhancing performance by reducing redundant computations, minimizing server load, and improving response times. Next.js provides several caching mechanisms tailored for various use cases, including server-side and client-side caching strategies.
Use Case | Recommended Strategy |
---|---|
Server-side disk cache | unstable_cache or "use cache" (canary) |
Server-side deduplication | React.cache |
Client-side in-memory cache | SWR , React Query |
Filesystem cache | CDN, Edge caching |
In the starter kit we make use of following server-side caching: