Important
Action needed for two new vulnerabilities
Auto-fix projects

Add cache tags from Function responses, regardless of framework

Authors

1 min read

You can now add one or more cache tags to your Function response by importing the addCacheTag function from @vercel/functions npm package.

import { addCacheTag } from '@vercel/functions'

Once the cached response has a tag associated with it, you can later invalidate the cache in one of several ways:

In addition to invalidating by tag, you can also dangerously delete by tag if the origin is gone. However, deleting the cache can increase latency while new content is generated or cause downtime if your origin is unresponsive, so use with caution.

Available on all plans and all frameworks.

Learn more about cache invalidation.