cache tag
A label attached to cached data, such as products, so all entries with that label can be invalidated together.
In more detail
Add tags with fetch(url, { next: { tags: ['products'] } }) or cacheTag() inside use cache, then call revalidateTag('products') after a change. One entry can carry several tags, such as a collection tag and a record tag.
Related terms
- revalidateTag — A function from next/cache that invalidates every cached entry labelled with a given tag, across all routes.
- Data Cache — The second Next.js caching tier: a server-side store of fetch results that persists across requests, users and deployments.
- cache invalidation — Marking cached copies as out of date, or deleting them, when the real data changes so the next read fetches fresh data.
Taught in
- Request Memoization: Automatic Deduplication Tiers — Next.js 15 & Modern App Router Architecture
- Data Cache: Cross-Request Persistence & Fetch Tags — Next.js 15 & Modern App Router Architecture
- Full Route Cache: Static Rendering & Segment Config — Next.js 15 & Modern App Router Architecture
- Revalidation Strategies: revalidatePath & Cache Life — Next.js 15 & Modern App Router Architecture