Vercel’s cache-tag purge API lets teams invalidate cached CDN, Runtime, and Data responses at runtime without cutting a new deployment. The purge invalidates stale content; it does not make the revalidation free. Pick the wrong verb and a single call can force foreground origin fetches across a hot tag, which is why dangerously-delete carries the name it does.
What Vercel’s purge API actually invalidates
Vercel’s purge API invalidates cached responses by cache tag, a surrogate key attached to a response, rather than by URL path or header pattern. The CDN cache’s own keys are not user-configurable, so selective invalidation works through a tag on the response: either one you assign at response time through the Vercel-Cache-Tag header, addCacheTag() from @vercel/functions, or cacheTag() from next/cache, or a system tag Vercel adds automatically, such as the source image attached to each Image Optimization response. Once a response carries a tag, purging it clears all three cache layers at once: the CDN cache, the Runtime Cache, and the Data Cache, according to the purge reference.
That all-at-once clearing is the design choice that matters. A layer-aware purge could leave the CDN refreshed while the Data Cache lags, one tier visibly stale as the other updates. Vercel’s model avoids that split by treating the tag as a single key across layers. The trade is that a tag purge cannot be narrowed to a single layer. The closest switch is the project-wide vercel cache purge --type, and even that is coarse: --type cdn clears the CDN cache alone, while --type data clears the Runtime and Data caches together, per the CLI reference. That coarseness is defensible, since partial invalidation is usually the source of cache-coherence bugs.
The tagging scheme is where the model earns its keep or breaks. Tags are typically derived from the entities a response depends on (a product ID, an author handle, a taxonomy term), so a single update to one entity can invalidate every page that renders it without enumerating URLs. The scheme has to be designed up front: responses tagged loosely over-purge, and responses tagged too narrowly under-purge and serve stale data.
Because the unit of invalidation is the tag, not the path, the scheme is the up-front investment. Design it once, attach tags per response as it is generated, and you can invalidate by entity later. Path-based invalidation, by contrast, requires enumerating every URL that changed, which is usually impractical for anything user-generated.
Invalidate vs dangerously-delete: the verb that decides origin load
As the purge reference describes it, invalidate keeps serving the cached response while it revalidates in the background, so end users see no added latency. dangerously-delete marks entries for deletion, so the next request fetches from the origin before responding, logged with cache status REVALIDATED, and when the tag covers many objects those foreground fetches can stampede the origin. The CLI makes the two states explicit: vercel cache invalidate serves STALE and revalidates in the background, while vercel cache dangerously-delete serves REVALIDATED and blocks while revalidating. The REST API, the dashboard, and @vercel/functions expose the same pair of verbs. next/cache is the exception, and the Next.js version decides what exists there: on Next.js 15 and earlier, revalidateTag() always deletes, with no invalidate counterpart in next/cache, so application code that wants serve-stale behavior on that version has to call invalidateByTag() from @vercel/functions instead. Next.js 16 and later add the missing half: revalidateTag(tag, 'max') invalidates.
The naming is unusually honest about the trade-off. There is no “safe” flag that makes delete throttle itself; the safety lives entirely in choosing invalidate instead, and in scoping the tag set so a single call cannot fan out across the whole cache.
The tagging surface and the CLI purge
The purge model has two halves: the tags you attach at response time, and the commands that invalidate them. The purge reference documents three ways to attach a tag, and the CLI is the command surface that fires by tag or by source image.
| Surface | Confirmed mechanisms |
|---|---|
| Tagging (response time) | Vercel-Cache-Tag response header; addCacheTag() from @vercel/functions; cacheTag() from next/cache |
| Vercel CLI purge | vercel cache invalidate, vercel cache dangerously-delete (both accept --tag or --srcimg); vercel cache purge clears CDN, Runtime, and Data cache for the current project, narrowed with --type cdn (CDN cache only) or --type data (Runtime and Data caches) |
The tagging surface extends into Next.js 16 as well: with Cache Components enabled, cache: remote stores a function’s return value in Runtime Cache and accepts cacheTag(), so it can be purged by tag like any other cached response, per the purge reference. On Next.js 15 and below, the Data Cache plays that role.
The CLI additionally offers --revalidation-deadline-seconds, which narrows a delete to entries not accessed within the given window, so you can expire a cold long tail without disturbing recently served objects. That is the closest thing to a built-in brake on a stampede, and it only applies to the delete path. The --srcimg form of either subcommand targets Image Optimization output by original image, and the value must exactly match how your app references that image, including any query parameters.
Two operational details belong in the same runbook. In non-interactive environments such as CI, vercel cache cannot prompt and exits without changing the cache, so automation needs --yes; the commands also act on the project linked to the current directory unless you pass --project. And on some plans the projects in a team share one Runtime or Data cache, in which case vercel cache purge deletes the cached data of every project in the team, per the CLI reference. That shared-cache reach is the strongest argument for the tag-scoped commands in anything automated.
Tags are bounded by limits worth keeping next to a runbook, per the purge reference: 256 UTF-8 bytes per tag, 128 tags per cached response, and 16 tags per bulk REST call.
Purge vs redeploy: why they aren’t interchangeable
A redeploy ships new code and creates a new deployment with its own cache key; a purge clears cached responses you are already serving. They solve different problems. Each deployment carries its own cache key, so promoting a new deployment to production does not touch the previous deployment’s cache. A purge clears all three cache layers (CDN, Runtime, and Data) within the tag’s scope, which is the project and environment rather than a single deployment; a redeploy, by contrast, simply points production at a fresh deployment.
Per-deployment keys make promotion and rollback safe: a new deployment gets its own cache, and previous deployments keep theirs. They do not contain a purge. Tag-based revalidation applies to every domain and deployment in the same project and environment, and a REST tag purge defaults to all environments, so production and preview stay separate only when you scope them separately. The practical split still follows. When the defect is in your data rather than your code, a purge is the cheaper fix and you keep your current deployment. When the defect is in your code, no amount of purging corrects it; a redeploy is the only real remedy, and reaching for a purge to “fix” a rendering bug just regenerates the same wrong output from the same code.
Where purge fits relative to ISR and Cache-Control headers
Three invalidation models sit on the same origin, and purge is the runtime escape hatch among them. Cache-Control headers tell the CDN how long to keep a response, but the CDN only learns a path is cacheable after the first response is served. ISR inverts that: Vercel knows a path is cacheable before the first request arrives, which enables request collapsing and durable storage that Cache-Control alone cannot provide. ISR cache is scoped per-deployment, persists until you revalidate it or it goes unaccessed for 31 days, and reaches all CDN regions within 300ms on an on-demand revalidation.
For practitioners, the decision is which model to make authoritative. Rely on Cache-Control and you get a portable TTL with no collapsing. Rely on ISR and you get request collapsing and durable storage in exchange for coupling your invalidation to the framework. Reach for a runtime purge when both of the above have served something you need gone immediately.
ISR revalidation primitives live in application code and fire on a content change; the CLI purge commands are operational tools a human or runbook triggers to correct something now, without a deploy. The two overlap in capability but serve different callers.
Scoping keeps a purge from being blunt, and the scope is the tag, not the deployment. Tags are scoped per project and environment: a purge fired from @vercel/functions uses the environment of the deployment that invoked the function, while a REST purge defaults to all environments unless you pass one. Pin the environment on REST calls and a misfire cannot reach preview from a production path. There is also a throughput ceiling to design around: purge calls made from your functions are rate limited per plan at 50 calls per second per team on Hobby, 200 on Pro, and 500 per project on Enterprise, counted per call rather than per tag and averaged over a 30-second window. Exceed it and Vercel rejects the call and leaves the cache unchanged; invalidateByTag() and dangerouslyDeleteByTag() throw an error carrying status 429, while the next/cache functions log a warning in runtime logs instead of throwing. CLI, REST, and dashboard purges sit under separate REST API rate limits.
The broader shift is from build-time cache control to runtime cache control. That is a capability win for content and ops teams, who no longer need a deploy to drop a stale page, but it relocates the burden of correctness: whoever holds the purge trigger now owns origin load, the environment parameter, and the retry behavior.
Join the discussion
Share a useful perspective or ask a question about this article.