← All tools

Next.js Cache & ISR Visualiser

Compare the three main caching strategies in the App Router and see when a request is served from the cache, when the cached copy goes stale and when it is refreshed.

Try it

Caching strategy

The cached copy is fresh for a set time. After that, the next request gets the old copy and refreshes it in the background.

Revalidates after 5m

0s10m
Fresh Stale Now

Nothing is cached yet. The next request will be a miss and store the response for 5m.

Requests

No requests yet. Move the slider and make a request.

Code

// In a Server Component or fetch()
const response = await fetch("https://api.example.com/data", {
  next: { revalidate: 300 }, // 5m
});

// Or as route segment config
export const revalidate = 300; // 5m

Why caching confuses people

Since Next.js 15, fetch() is not cached by default. Whether a response is cached depends on the options you pass, and on the route segment config, so it is worth knowing which one applies to each request. The visualiser above follows the same rules as the framework: a cached copy is fresh for its window, a request after that window gets the old copy and triggers a refresh, and the next request after the refresh is fresh again.

When to use each strategy

Force cache

Use it when the data only changes on deployment, such as a list of static pages or content that is built into the site. The response is kept until the next deployment.

ISR (revalidate)

Use it when content changes now and then but does not need to be exact on every request, such as blog posts, product listings or marketing pages. Visitors get a fast response, and the page updates shortly after a change. The trade-off is that the first request after the window can show the previous version.

No store

Use it when every visitor must see current data, such as account pages, live prices or personalised feeds. Every request goes to the origin, so responses are slower and cost more to serve.

More

Read more about caching and performance on the blog, or try the Core Web Vitals checker to see how your pages load.