Revalidating by cache tag
Answer: revalidateTag allows you to invalidate cached data on-demand for a specific cache tag. Call it in Server Functions and Route Handlers.
Behavior
revalidateTag marks tagged cache entries stale while still serving them briefly. It cannot be called in Client Components or Proxy.
Versus path invalidation
revalidatePath invalidates a specific route path. Tags work when the same tagged data is used across pages.
See also
Claims
- id: C1 claim: revalidateTag runs in Server Functions. source: S1 evidence: "
revalidateTagcan be called in Server Functions and Route Handlers."
- id: C2 claim: revalidateTag invalidates a cache tag. source: S1 evidence: "
revalidateTagallows you to invalidate cached data on-demand for a specific cache tag."
- id: C3 claim: revalidateTag is server-only. source: S1 evidence: "
revalidateTagcannot be called in Client Components or Proxy, as it only works in server"
- id: C4 claim: Tagged invalidation uses stale-while-revalidate semantics. source: S2 evidence: "
revalidateTaginvalidates cache entries by tag using stale-while-revalidate semantics — stale content is served immediately"
Sources
- [S1] revalidateTag. Next.js docs. https://nextjs.org/docs/app/api-reference/functions/revalidateTag . License: MIT (vercel/next.js). Accessed 2026-11-09.
- [S2] Revalidating. Next.js docs. https://nextjs.org/docs/app/getting-started/revalidating . License: MIT (vercel/next.js). Accessed 2026-11-09.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Copyright (c) 2025 Vercel, Inc. Sources: Next.js docs (vercel/next.js on GitHub / nextjs.org), MIT (https://raw.githubusercontent.com/vercel/next.js/canary/license.md). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Next.js docs, revalidateTag, MIT (vercel/next.js); Next.js docs, Revalidating, MIT (vercel/next.js). Copyright (c) 2025 Vercel, Inc. MIT (https://raw.githubusercontent.com/vercel/next.js/canary/license.md).
Cite this
iinventedlight. 2026. "Revalidating by cache tag." iinventedlight Library, iil:note:n2hf6h7h, version of 2026-11-09. https://iinventedlight.com/library/notes/nextjs-revalidate-tag/. License: CC-BY-4.0.
@misc{iil_note_n2hf6h7h,
author = {{iinventedlight}},
title = {{Revalidating by cache tag}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-09},
url = {https://iinventedlight.com/library/notes/nextjs-revalidate-tag/},
note = {Permanent ID iil:note:n2hf6h7h. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/nextjs-revalidate-tag.md.