runtime-cache

Implements Vercel Runtime Cache key-value storage with tag-based invalidation for serverless functions.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/ridhijain709/AIPORSCHE --skill runtime-cache-ridhijain709
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: runtime-cache
Source: https://github.com/ridhijain709/AIPORSCHE/tree/main/.agents/skills/runtime-cache
Command: npx skills add https://github.com/ridhijain709/AIPORSCHE --skill runtime-cache-ridhijain709

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @vercel/functions.

What problem does it solve? Caching data across serverless function invocations is difficult because instances are ephemeral and regional. This Skill guides you through using the Vercel Runtime Cache API to store, retrieve, and invalidate cached data with tags, avoiding redundant database queries and external API calls. ## Core Features & Use Cases - Key-Value Cache Operations: Set, get, and delete cached entries with TTLs, namespaces, and custom key hashing via @vercel/functions. - Tag-Based Invalidation: Expire groups of cached entries with expireTag, or purge across CDN, Runtime, and Data caches with invalidateByTag and dangerouslyDeleteByTag. - Next.js Integration: Use 'use cache: remote' with cacheTag and cacheLife in Next.js 16, plus the updated revalidateTag signatures. - Use Case: A CMS webhook triggers a Server Action that calls expireTag('blog'), invalidating all cached blog posts across functions in the region within 300ms. ## Quick Start Ask the AI to add Vercel Runtime Cache caching with tag-based invalidation to your API route using @vercel/functions.

Frequently Asked Questions about runtime-cache

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

FAQPage Schema
How do I use the Vercel Runtime Cache API in a serverless function?

Import getCache from @vercel/functions, then call cache.set with a key, value, TTL, and tags, and cache.get to retrieve values. The cache is regional, scoped per project and deployment environment, and shared across functions in that region.

How does tag-based cache invalidation work on Vercel?

Tag-based invalidation lets you assign tags when calling cache.set, then expire all matching entries with cache.expireTag, which propagates globally within 300ms. For purging across CDN, Runtime, and Data caches together, use invalidateByTag or dangerouslyDeleteByTag.

What is the difference between 'use cache' and 'use cache: remote' in Next.js?

'use cache' stores data in memory only, ephemeral per instance, while 'use cache: remote' stores data in the Vercel Runtime Cache. The remote directive requires Next.js 16 with cacheComponents enabled in next.config.ts.

Does revalidateTag invalidate the Vercel Runtime Cache?

No, Next.js revalidateTag and revalidatePath do not invalidate the Runtime Cache, and cache.expireTag does not invalidate ISR pages. To purge both layers, use the same tag and call invalidateByTag, which hits all cache layers.

When should I not use the Vercel Runtime Cache?

Avoid it for persistent storage, cross-region shared state, user-specific per-request data, and framework-level page caching. Use a database like Neon or Upstash for persistence, Cache-Control headers for CDN response caching, and Next.js Cache Components for page caching.

What are the Vercel Runtime Cache size and tag limits?

Items are limited to 2 MB, with up to 64 tags per Runtime Cache item and 128 per CDN item. Tags have a 256-byte maximum length, are case-sensitive, and cannot contain commas.