Skip to main content

Caching for Next.jss

Caching in Next.js is the set of stores that avoid repeating work, such as cached fetch results, prerendered pages and the browser-side router cache. Revalidation by time or by tag decides when entries refresh. Built-in image, font and metadata features also reduce payload size and improve search previews.

Stage: Data and Caching · Part of the Next.js roadmap · Last reviewed 19 November 2026

What to learn in Caching

Caching interview questions

What is the difference between time-based and on-demand revalidation in Next.js?

Time-based revalidation marks cached data stale after a set number of seconds and refreshes it on the next request. On-demand revalidation clears entries immediately when you call revalidateTag or revalidatePath, usually after a mutation or a webhook from a CMS.

Why use next/image instead of a plain img tag?

The Image component resizes and converts pictures to modern formats, serves sizes suited to the device, lazy loads below-the-fold images, and requires dimensions so the layout does not shift. These behaviours improve loading speed and Core Web Vitals without manual work.

Where Caching fits in the Next.js roadmap

Caching belongs to the Data and Caching stage (intermediate level), which takes about 16 hours. Fetch what you need.

Back to the full Next.js roadmap