runtime-cache

Store and invalidate per-region cache entries in Vercel Functions and middleware.

77|3|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/FlorianBruniaux/starmapper --skill runtime-cache-florianbruniaux
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: runtime-cache
Source: https://github.com/FlorianBruniaux/starmapper/tree/main/.agents/skills/runtime-cache
Command: npx skills add https://github.com/FlorianBruniaux/starmapper --skill runtime-cache-florianbruniaux

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a per-region ephemeral key-value cache API for Vercel Functions, Routing Middleware, and Builds, enabling fast, region-local data access and automatic eviction.

Core Features & Use Cases

  • Regional caching: store API responses and computed data close to users to reduce latency and load.
  • Tag-based invalidation: invalidate groups of cache entries efficiently when content changes.
  • Next.js integration: works with Next.js 16+ cache patterns and the Vercel Runtime Cache API surface.

Quick Start

Enable the runtime cache and store a sample value with a TTL using getCache().

Frequently Asked Questions about runtime-cache

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

FAQPage Schema
How do I cache API responses in Vercel serverless functions?

You can cache API responses in Vercel serverless functions by using the per-region ephemeral cache API to store frequently used results, reducing repetitive data fetching and latency. This cache is accessible directly from Vercel Functions and middleware.

How does tag-based cache invalidation work for serverless applications?

Tag-based cache invalidation groups cache entries by assigned tags, allowing you to selectively expire specific data groups when content changes. This ensures efficient, targeted eviction without clearing the entire regional cache.

Does the Vercel runtime cache work with Next.js 16+ remote cache patterns?

Yes, the runtime cache interoperates with Next.js 16+ cache patterns and satisfies the Vercel Runtime Cache API surface. It supports remote cache usage, allowing seamless integration with modern Next.js data fetching and caching workflows.

Can I set a TTL for ephemeral data stored in Vercel functions?

Yes, you can set a Time-to-Live (TTL) when storing values in the runtime cache to automatically evict data after a specified duration. This ensures your regional cache remains fresh without manual deletion.

What is the best way to reduce latency for regional serverless deployments?

Implementing a per-region ephemeral cache is the best way to reduce latency, storing computed data and API responses close to users. This minimizes cross-region data fetching and lowers response times.

When should I not use an ephemeral cache for serverless apps?

You should avoid using ephemeral regional caches for persistent data storage or when immediate cross-region data consistency is required. Since the cache is ephemeral, data is subject to automatic eviction and may not synchronize instantly across regions.