runtime-cache

Provide per-region ephemeral key-value caching with tag-based invalidation for Vercel Functions.

246|42|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/vercel/vercel-plugin --skill runtime-cache-vercel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: runtime-cache
Source: https://github.com/vercel/vercel-plugin/tree/main/skills/runtime-cache
Command: npx skills add https://github.com/vercel/vercel-plugin --skill runtime-cache-vercel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a per-region ephemeral key-value cache with tag-based invalidation for Vercel Functions, Routing Middleware, and Builds.

Core Features & Use Cases

  • Regional isolation across serverless functions and builds
  • Tag-based invalidation for granular cache control
  • Framework-agnostic usage via @vercel/functions with Next.js integration and CLI support

Quick Start

Store a value with a TTL and tags using getCache().set, then read it with getCache().get and invalidate by tag when needed.

Frequently Asked Questions about runtime-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use tag-based cache invalidation for Vercel serverless functions?

You can achieve tag-based cache invalidation in Vercel serverless functions by storing values with assigned tags using getCache().set, then invalidating specific tags when data changes to maintain granular control.

What is per-region ephemeral caching in Next.js and when do I need it?

Per-region ephemeral caching provides isolated key-value storage across Vercel serverless functions and builds. You need it when requiring regional isolation and temporary runtime cache with tag expiration for your Next.js application.

Does the Vercel runtime cache work with frameworks other than Next.js?

Yes, the Vercel runtime cache is framework-agnostic and can be used via @vercel/functions. It also provides specific Next.js integration and CLI support for cache operations across your stack.

How do I set a TTL and read values from a Vercel regional cache?

To set a TTL and read values, use getCache().set to store your value with a time-to-live and associated tags, then retrieve it later using getCache().get within your Vercel functions or middleware.

Can I use runtime cache APIs in Vercel Middleware and Builds?

Yes, runtime cache APIs are supported across Vercel Functions, Routing Middleware, and Builds. This allows you to manage deployment-environment isolation and caching consistently across your infrastructure.

What are the limitations of ephemeral key-value caching on Vercel?

The ephemeral key-value cache is isolated per region and deployment environment, meaning cached data is temporary and will expire based on TTL. It is designed for runtime caching rather than persistent data storage.