
Runtime Cache
Add Vercel’s per-region Runtime Cache with tag invalidation across Functions, Middleware, and Builds when framework caching is not enough.
Install
npx skills add https://github.com/vercel-labs/vercel-plugin --skill runtime-cacheWhat is this skill?
- Ephemeral per-region key-value Runtime Cache shared by Functions, Routing Middleware, and Builds
- Tag-based invalidation for coordinated cache busting across routes and jobs
- Guidance beyond Next.js or framework-level caching only
- Validates direct redis/ioredis usage and steers upgrades toward serverless-friendly @upstash/redis via vercel-storage
- Retrieval aliases: cache api, kv cache, region cache, tag invalidation
Adoption & trust: 250 installs on skills.sh; 187 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Entra App Registrationmicrosoft/azure-skills
Azure Aigatewaymicrosoft/azure-skills
Lark Openapi Explorerlarksuite/cli
Supabasesupabase/agent-skills
Firebase Auth Basicsfirebase/agent-skills
Firebase Data Connectfirebase/agent-skills
Journey fit
Primary fit
Runtime Cache is implemented while wiring serverless backends and shared cache helpers on Vercel. It is an integration skill for @vercel/functions cache APIs and lib/cache-style modules, not a launch or ops playbook alone.
Common Questions / FAQ
Is Runtime Cache safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Runtime Cache
# 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 ```ts import { getCache } from '@vercel/functions'; const cache = getCache(); // Store data with TTL and tags await cache.set('user:123', userData, { ttl: 3600, // seconds tags: ['users', 'user:123'], // for bulk invalidation name: 'user-profile', // human-readable label for observability }); // Retrieve cached data (returns value or undefined) const data = await cache.get('user:123'); // Delete a specific key await cache.delete('user:123'); // Expire all entries with a tag (propagates globally within 300ms) await cache.expireTag('users'); await cache.expireTag(['users', 'user:123']); // multiple tags ``` ### Cache Options ```ts const cache = getCache({ namespace: 'api', // prefix for keys namespaceSeparator: ':', // separator (default) keyHashFunction: (key) => sha256(key), // custom key hashing }); ``` ### Full Example (Framework-Agnostic) ```ts import { getCache } from '@vercel/functions'; export default { async fetch(request: Request) { const cache = getCache(); const cached = await cache.get('blog-posts'); if (cached) { return Respons