Fetch cache
HIT, HMR, MISS and SKIP, the hit rate and the cache reasons.
With request insights enabled, NextToolbar shows every fetch your server components made and what Next's data cache did with it.
Outcomes
These are the values Next records internally (next/dist/server/lib/patch-fetch.js):
| Outcome | Meaning |
|---|---|
| HIT | Served from the data cache. |
| HMR | Dev only: reused across a hot reload so editing code doesn't refetch everything. |
| MISS | Cacheable; fetched from the origin and stored. |
| SKIP | Not cacheable: no-store, revalidate: 0, a hard refresh… |
| ? | No cache information: the fetch failed, or the Next version doesn't report it. |
Hit rate
hit rate = (HIT + HMR) / (HIT + HMR + MISS)SKIP and unknown fetches are left out: they were never meant to be cached, so they shouldn't pull the rate down. If nothing was cacheable, no rate is shown.
Cache reasons
Next attaches a reason to each outcome. The profiler shows it next to the pill:
| Reason | What caused it |
|---|---|
revalidate: never | cache: 'force-cache' (Next stores it as an "infinite" revalidate, 4294967294 s) |
revalidate: 30 | next: { revalidate: 30 } or the segment's revalidate |
cache: no-store / cache: no-cache | The fetch options |
fetchCache = … | The segment's fetchCache config |
noStore call | noStore() was called before the fetch |
auto cache / auto no cache | No explicit option: Next decided (e.g. POST or auth headers → no cache) |
cache-control: no-cache (hard refresh) | The browser did a hard reload; Next skipped the cache on purpose |
Where you see it
- Toolbar:
fetch 3 · 67% hitfor the current page. - Fetch panel (hover): outcome chips (
HIT 2 · SKIP 1) and each fetch with its outcome, time, tags and freshness. - Profiler: a table per request with outcome and reason, and the totals of every captured request in the header.
Tags and revalidation
Think react-query devtools, for the server: a fetch's tag is its query key, its revalidate is the stale time, and revalidating a tag is invalidateQueries.
fetch(`${api}/products`, { next: { tags: ['products'], revalidate: 60 } })With the server route mounted, the fetch panel shows for each fetch:
- Freshness:
fresh · stale in 45s,stale for 12s, orcached, no expiryforforce-cache. - Its tags, and a ↻ button that runs
revalidateTag(tag, { expire: 0 })for them and refreshes the page. Only fetches carrying the tag are fetched again; everything else stays cached. - Response headers (collapsed), from the cached response;
set-cookievalues are hidden. The request's own headers and body aren't shown: Next's cache doesn't keep them, only a hash of them as the cache key. - This page at the bottom:
revalidatePathfor the current path, for fetches without tags.
To revalidate a tag that isn't on the current page, type it in the Server Actions panel.
Try it: the list below plays the page, the toolbar at the bottom of the screen shows its fetches.
Hover fetch in the toolbar below and click a tag. Only the fetches carrying it are fetched again.
| Fetch | Tags | Fetched at | Cache |
|---|---|---|---|
| GET /products | #products | — | — |
| GET /categories | #categories | — | — |
| GET /settings | none | — | — |
Request insights don't carry tags, so the server route reads them from Next's data cache on disk (.next/dev/cache/fetch-cache) and the toolbar matches them to the page's fetches by URL. Fetches with cache: 'no-store' are never stored and have no tags. 'use cache' with cacheTag lives in memory and isn't shown.
On a staging server
On a production build with staging access, there are no request insights, so the toolbar can't know which fetches this request made. The segment turns into cached fetches: every entry in Next's data cache (.next/cache/fetch-cache), newest first, for the whole app, not only the current page.
Each row shows:
- The URL and the cached response's HTTP status (the method isn't cached; Next only caches
GETunless forced). - Freshness:
fresh · stale in 45s,stale for 12s, orcached, no expiry. - Tags, with the ↻ button to revalidate them, and Response headers (collapsed,
set-cookiehidden).
What it can't show: time, HIT / MISS / SKIP and the cache reason, which only come from request insights. Fetches with cache: 'no-store' are never stored, so they never appear. The list is read when the page loads and every time you open the segment; after revalidating, the new entry shows up once a page reads that fetch again.
A worked example
The playground has a /cache page with three fetches to a local API:
fetch(`${api}?forced`, { cache: 'force-cache' })
fetch(`${api}?revalidated`, { next: { revalidate: 30 } })
fetch(`${api}?fresh`, { cache: 'no-store' })| Load | forced | revalidated | fresh | Rate |
|---|---|---|---|---|
| Hard refresh (Ctrl+Shift+R) | SKIP (hard refresh) | SKIP (hard refresh) | SKIP (no-store) | — |
| Client navigation | HIT (never) | HIT (30) | SKIP (no-store) | 100% |
| After editing a file | HMR | HMR | SKIP | 100% |
The no-store fetch is also why this page shows Dynamic even though Next's dev data says static. See Render mode.