Understanding Next.js Caching
Next.js has four distinct caching mechanisms. Understanding when and how each works is crucial for building performant applications.
Learning Objectives
Lesson Outline
Next.js has four distinct caching mechanisms. Understanding when and how each works is crucial for building performant applications.
React automatically memoizes fetch requests with the same URL and options during a single render.
Next.js extends fetch to cache responses on the server, persisting across requests.
At build time (or revalidation), Next.js caches the rendered HTML and RSC Payload.
The browser caches visited routes and prefetched routes.