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

It’d be great to be able to use the REST API or the SDK to be able to clear the 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.

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.

There’s a button in Settings that lets you purge the Data Cache. But you can also invalidate cached data programmatically with revalidateTag or revalidatePath. Would that work for your setup?

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.