vercel avatar

Runtime Cache

This is Vercel's ephemeral key-value cache that lives at the edge, shared across functions, middleware, and builds. It's what you reach for when Next.js's built-in caching isn't granular enough and you need tag-based invalidation without managing Redis infrastructure. The skill covers the `@vercel/functions` APIs, tag expiration patterns, and the critical distinction between `cache.expireTag()` (runtime only) versus `invalidateByTag()` (purges CDN, runtime, and data layers). One thing to know: it's regionally isolated and scoped per environment, so production and preview caches never mix. Useful validation rule catches direct Redis/ioredis imports and suggests Upstash instead for serverless compatibility.

skills.sh installs
312
GitHub stars
183
last updated
Jun 3, 2026

Install

$ npx -y skills add vercel/vercel-plugin --skill runtime-cache --agent claude-code

Installs into .claude/skills of the current project.

Files

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 deployment environment (preview vs production); scoped per project on Pro/Enterprise, but shared across all projects on a Hobby team
  • Persistent across deployments: Cached data survives new deploys (except Next.js 16 use cache: remote entries, keyed per build); 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();

Sponsors

Details

Repository
github.com/vercel/vercel-plugin
Category
Cloud & Infrastructure
First seen
Jun 3, 2026

More from vercel/vercel-plugin

All 25
1itsmostafa avatarcloudwatchitsmostafa/aws-agent-skillsAWS CloudWatch monitoring for logs, metrics, alarms, and dashboards. Use when setting up monitoring, creating alarms, querying logs with Insights, configuring m245skills.sh installs
2itsmostafa avatarapi-gatewayitsmostafa/aws-agent-skillsAWS API Gateway for REST and HTTP API management. Use when creating APIs, configuring integrations, setting up authorization, managing stages, implementing rate142skills.sh installs
3crmagz avatarnaming-conventionscrmagz/cdk-constructs-libraryNaming conventions for types, functions, files, and resources. Use when creating new code or reviewing naming patterns. Emphasizes type-driven development.0skills.sh installs
4heygen-com avatarhyperframes-cliheygen-com/hyperframesUse the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, 1.5Mskills.sh installs
5microsoft avatarappinsights-instrumentationmicrosoft/azure-skillsGuidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrumen658.4Kskills.sh installs
6microsoft avatarentra-app-registrationmicrosoft/azure-skillsGuides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure O658.3Kskills.sh installs