revalidateTag
A function from next/cache that invalidates every cached entry labelled with a given tag, across all routes.
In more detail
revalidateTag('inventory') marks every fetch and use cache result tagged inventory as stale, along with pages built from them. They are regenerated the next time they are requested.
Related terms
- cache tag — A label attached to cached data, such as products, so all entries with that label can be invalidated together.
- revalidatePath — A function from next/cache that invalidates cached data and pages for a given URL path.
- revalidation — Refreshing cached data or pages so they show new content, either after a time limit or on demand.
Taught in
- Data Cache: Cross-Request Persistence & Fetch Tags — Next.js 15 & Modern App Router Architecture
- Router Cache: In-Memory Client Prefetch Semantics — Next.js 15 & Modern App Router Architecture
- Revalidation Strategies: revalidatePath & Cache Life — Next.js 15 & Modern App Router Architecture