[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Feedback](/c/feedback/8)

# Vercel/sdk and/or REST API request: ability to purge the data cache

148 views · 1 like · 2 posts


Phil Wolstenholme (@philwolstenholme) · 2024-12-11

It'd be great to be able to use the REST API or the SDK to be able to clear the [data cache](https://vercel.com/docs/infrastructure/data-cache).

Purging the entire cache would be a good start, but it'd also be neat to be able to purge by a particular [cache tag](https://vercel.com/docs/infrastructure/data-cache#tag-based-revalidation).

The cache can be purged by a server action, but sometimes you'll want to purge a cache independently of user activity on your site.

A real-life example from my team:

Earlier this week a provider we use for postal address information made a mistake in their API and we were caching invalid responses. We had to purge our entire cache, throwing away a bunch of cached product and CMS data unnecessarily. It would have been able to make a HTTP request to clear just the cache entries tagged with `address` or the name of the provider.


Amy Egan (@amyegan) · 2024-12-11 · ♥ 1

There's a button in Settings that lets you [purge the Data Cache](https://vercel.com/docs/infrastructure/data-cache/manage-data-cache#purging-data-cache). But you can also [invalidate cached data](https://vercel.com/docs/infrastructure/data-cache#revalidation-behavior) programmatically with `revalidateTag` or `revalidatePath`. Would that work for your setup?