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.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
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.
[{"pattern":"from\\s+['\"\"](redis|ioredis)['\"\"]|require\\s*\\(\\s*['\"\"](redis|ioredis)['\"\"]|new\\s+Redis\\(","message":"Direct Redis/ioredis client detected. Use Upstash Redis (@upstash/redis) for serverless-native Redis with HTTP-based connections.","severity":"recommended","upgradeToSkill":"vercel-storage","upgradeWhy":"Replace direct Redis/ioredis with @upstash/redis for serverless-compatible HTTP-based Redis that works without persistent TCP connections.","skipIfFileContains":"from\\s+['\"\"]\\@upstash/redis['\"\"]"}]
retrieval
{"aliases":["cache api","kv cache","region cache","tag invalidation"],"intents":["add caching","cache api response","invalidate cache","set up runtime cache"],"entities":["Runtime Cache","tag-based invalidation","key-value","cache"]}
chainTo
[{"pattern":"from\\s+['\"\"]@vercel/kv['\"\"]","targetSkill":"vercel-storage","message":"@vercel/kv is sunset — loading Vercel Storage guidance for Upstash Redis migration."},{"pattern":"from\\s+['\"\"]ioredis['\"\"]|new\\s+Redis\\(","targetSkill":"vercel-storage","message":"Direct Redis client detected — loading Vercel Storage guidance for Upstash Redis (serverless-native) integration."}]
Vercel Runtime Cache API
You are an expert in the Vercel Runtime Cache — an ephemeral caching layer for serverless compute.
What It Is
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.
Regional: Each Vercel region has its own isolated cache
Isolated: Scoped per project AND per deployment environment (preview vs production)
Persistent across deployments: Cached data survives new deploys; invalidation via TTL or expireTag
Ephemeral: Fixed storage limit per project; LRU eviction when full
Framework-agnostic: Works with any framework via @vercel/functions
Key APIs
All APIs from @vercel/functions:
Basic Cache Operations
import { getCache } from'@vercel/functions';
const cache = getCache();
// Store data with TTL and tagsawait cache.set('user:123', userData, {
ttl: 3600, // secondstags: ['users', 'user:123'], // for bulk invalidationname: 'user-profile', // human-readable label for observability
});
// Retrieve cached data (returns value or undefined)const data = await cache.get('user:123');
// Delete a specific keyawait cache.delete();
cache.();
cache.([, ]);
'user:123'
// Expire all entries with a tag (propagates globally within 300ms)
Tags are case-sensitive and cannot contain commas.
Observability
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.
When to Use
Caching API responses or computed data across functions in a region
Tag-based invalidation when content changes (CMS webhook → expire tag)
Reducing database load for frequently accessed data
Cross-function data sharing within a region
When NOT to Use
Framework-level page caching → use Next.js Cache Components ('use cache')
Persistent storage → use a database (Neon, Upstash)
CDN-level full response caching → use Cache-Control / Vercel-CDN-Cache-Control headers