Visitar URL original
vercel cacheSkip to content

vercel cache

The vercel cache command is used to manage the cache for your project, such as CDN cache and Runtime cache.

Learn more about purging Vercel cache.

terminal
vercel cache purge

Using the vercel cache purge command to purge the CDN cache, Runtime cache, and Data cache for the current project.

On some plans, the projects in your team share one Runtime cache or Data cache. Purging a shared cache deletes the cached data of every project in your team. See storage scope by plan for Runtime cache and Data cache.

terminal
vercel cache purge --type cdn

Using the vercel cache purge --type cdn command to purge the CDN cache for the current project.

terminal
vercel cache purge --type data

Using the vercel cache purge --type data command to purge the Runtime cache and Data cache for the current project.

terminal
vercel cache invalidate --tag blog-posts

Using the vercel cache invalidate --tag blog-posts command to invalidate the cached content associated with tag "blog-posts" for the current project. Subsequent requests for this cached content will serve STALE and revalidate in the background.

terminal
vercel cache dangerously-delete --tag blog-posts

Using the vercel cache dangerously-delete --tag blog-posts command to dangerously delete the cached content associated with tag "blog-posts" for the current project. Subsequent requests for this cached content will serve REVALIDATED and therefore block while revalidating.

terminal
vercel cache invalidate --srcimg /api/avatar/1

Using the vercel cache invalidate --srcimg /api/avatar/1 command to invalidate all cached content associated with the source image "/api/avatar/1" for the current project. Subsequent requests for this cached content will serve STALE and revalidate in the background.

terminal
vercel cache dangerously-delete --srcimg /api/avatar/1

Using the vercel cache dangerously-delete --srcimg /api/avatar/1 command to dangerously delete all cached content associated with the source image "/api/avatar/1" for the current project. Subsequent requests for this cached content will serve REVALIDATED and therefore block while revalidating.

terminal
vercel cache dangerously-delete --srcimg /api/avatar/1 --revalidation-deadline-seconds 604800

Using the vercel cache dangerously-delete --srcimg /api/avatar/1 --revalidation-deadline-seconds 604800 command to dangerously delete all cached content associated with the source image "/api/avatar/1" for the current project if not accessed in the next 604800 seconds (7 days).

These are options that only apply to the vercel cache command.

The --tag option specifies which tag to invalidate or delete from the cache. You can provide a single tag or multiple comma-separated tags. This option works with both invalidate and dangerously-delete subcommands.

terminal
vercel cache invalidate --tag blog-posts,user-profiles,homepage

Using the vercel cache invalidate command with multiple tags.

The --srcimg option specifies a source image to invalidate or delete from the cache. This invalidates or deletes all cached transformations of the source image. This option works with both invalidate and dangerously-delete subcommands.

The value must exactly match how your app references the source image (a relative path or a full URL), including any query parameters. Unlike user-defined cache tags, source image tags may contain commas and have a maximum length of 1013 bytes of UTF-8.

You can't use both --tag and --srcimg options together. Choose one based on whether you're invalidating cached content by tag or by source image.

terminal
vercel cache invalidate --srcimg /api/avatar/1

Using the vercel cache invalidate command with a source image path.

The --revalidation-deadline-seconds option sets a deadline, in seconds, before dangerously-delete deletes the cached content. If a request for the content arrives before the deadline, Vercel serves the stale content and revalidates it in the background. If no request arrives before the deadline, Vercel deletes the content. Use this option only with the dangerously-delete subcommand:

terminal
vercel cache dangerously-delete --tag blog-posts --revalidation-deadline-seconds 3600

Using the vercel cache dangerously-delete command with a 1-hour (3600 seconds) revalidation deadline.

By default, vercel cache acts on the project that the current directory is linked to. To purge, invalidate, or delete the cache of another project, pass its name or ID with the --project option, shorthand -p:

terminal
vercel cache purge --project my-project

Using the vercel cache purge command with the --project option.

The --yes option can be used to bypass the confirmation prompt when purging the cache, invalidating cached content, or dangerously deleting cached content. In non-interactive environments like CI, the command can't prompt and exits without changing the cache, so pass --yes:

terminal
vercel cache purge --yes

Using the vercel cache purge command with the --yes option.

The following global options can be passed when using the vercel cache command:

For more information on global options and their usage, refer to the options section.

Last updated September 15, 2026

Was this helpful?

supported.