npx skills add ...
npx skills add openai/plugins --skill runtime-cache
Vercel Runtime Cache API guidance — ephemeral per-region key-value cache with tag-based invalidation. Shared across Functions, Routing Middleware, and Builds. Use when implementing caching strategies beyond framework-level caching.
npx skills add openai/plugins --skill runtime-cache
You are an expert in the Vercel Runtime Cache — an ephemeral caching layer for serverless compute.
The Runtime Cache is a per-region key-value store accessible from Vercel Functions, Routing Middleware, and Builds. It supports tag-based invalidation for granular cache control.
preview vs production)expireTag@vercel/functionsAll APIs from @vercel/functions:
These purge across all three cache layers (CDN + Runtime Cache + Data Cache):
Important distinction:
cache.expireTag() — operates on Runtime Cache onlyinvalidateByTag() / dangerouslyDeleteByTag() — purges CDN + Runtime + Data cachesuse cache: remote)'use cache' (no : remote) — in-memory only, ephemeral per instance'use cache: remote' — stores in Vercel Runtime Cache| Function | Context | Behavior |
|---|---|---|
updateTag(tag) | Server Actions only | Immediate expiration, read-your-own-writes |
revalidateTag(tag, 'max') | Server Actions + Route Handlers | Stale-while-revalidate (recommended) |
revalidateTag(tag, { expire: 0 }) | Route Handlers (webhooks) | Immediate expiration from external triggers |
Important: Single-argument revalidateTag(tag) is deprecated in Next.js 16. Always pass a cacheLife profile as the second argument.
cache.expireTag does NOT invalidate ISR cacherevalidatePath / revalidateTag does NOT invalidate Runtime CacheinvalidateByTag (hits all cache layers)Note: --tag and --srcimg cannot be used together.
Add tags to CDN cached responses for later invalidation:
| Property | Limit |
|---|---|
| Item size | 2 MB |
| Tags per Runtime Cache item | 64 |
| Tags per CDN item | 128 |
| Max tag length | 256 bytes |
| Tags per bulk REST API call | 16 |
Tags are case-sensitive and cannot contain commas.
Monitor hit rates, invalidation patterns, and storage usage in the Vercel Dashboard under Observability → Runtime Cache. The CDN dashboard (March 5, 2026) provides a unified view of global traffic distribution, cache performance metrics, a redesigned purging interface, and project-level routing — update response headers or rewrite to external APIs without triggering a new deployment. Project-level routes are available on all plans and take effect instantly.
'use cache')Cache-Control / Vercel-CDN-Cache-Control headers