runtime-cache

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

Updated Dec 12, 2025
One-click install
npx skills add https://github.com/global-os/gproxy --skill runtime-cache-global-os
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: runtime-cache
Source: https://github.com/global-os/gproxy/tree/main/.agents/skills/runtime-cache
Command: npx skills add https://github.com/global-os/gproxy --skill runtime-cache-global-os

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @vercel/functions, @upstash/redis, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the need for efficient caching in serverless applications, enabling developers to implement caching strategies beyond framework-level caching.

Core Features & Use Cases

  • Regional Caching: Leverages per-region key-value stores for isolated, efficient caching.
  • Tag-Based Invalidation: Provides granular control over cache invalidation using tags.
  • Ephemeral Storage: Offers a limited, fixed storage limit per project, with LRU eviction.
  • Framework-Agnostic: Supports caching with any framework using @vercel/functions.
  • Use Case: Enhance the performance of API responses or computed data across functions by caching them regionally.

Quick Start

Set up runtime caching in your Vercel project using the getCache function from @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 implement regional caching in Vercel serverless functions?

You can implement regional caching by using the `getCache` function from `@vercel/functions` alongside an Upstash Redis connection. This setup provides an ephemeral key-value store for caching data in serverless applications.

What is the best way to invalidate serverless cache entries by tag?

Tag-based cache invalidation provides granular control over cached data by grouping keys with tags. You can purge specific tagged entries instead of clearing the entire regional cache when underlying data changes.

Do I need Upstash Redis for ephemeral caching with Vercel Functions?

Yes, Upstash Redis is required for serverless-compatible caching with this setup. It provides the per-region key-value store infrastructure necessary to maintain ephemeral caches with LRU eviction across your Vercel project.

Can I use runtime caching with routing middleware on Vercel?

Yes, runtime caching is designed for use with Vercel Functions and Routing Middleware. It supports caching API responses or computed data across functions framework-agnostically using `@vercel/functions`.

What are the storage limitations of ephemeral regional caching?

Ephemeral regional caching offers a limited, fixed storage limit per project. When the storage capacity is reached, it uses LRU (Least Recently Used) eviction to automatically remove the oldest cached data.