caching

Define cache invalidation, TTL, and key schemas for in-memory, Redis, and CDN layers.

5|3|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/zebbern/termstack --skill caching-zebbern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caching
Source: https://github.com/zebbern/termstack/tree/main/.github/skills/caching
Command: npx skills add https://github.com/zebbern/termstack --skill caching-zebbern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Caching is essential for fast, scalable APIs but incorrect invalidation or stale data can break user trust. This skill provides a structured approach to designing and reviewing caching layers across in-memory, Redis, and CDN so data stays fresh without unnecessary load.

Core Features & Use Cases

  • Invalidation strategies that ensure data freshness after writes.
  • TTL guidelines tailored to data volatility and layer (in-memory, Redis, CDN).
  • Cache-key schemas that prevent collisions and stale responses.
  • Use cases spanning API responses, configuration caches, and static assets.

Quick Start

Apply the caching guidelines to an API endpoint and verify correct invalidation, TTLs, and key hygiene.

Frequently Asked Questions about caching

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

FAQPage Schema
How do I prevent stale data with API caching invalidation strategies?

API caching invalidation prevents stale data by applying structured rules like P0/P1/P2 priorities, ensuring data freshness immediately after writes while maintaining high performance across in-memory, Redis, and CDN layers.

What are the best practices for setting TTL in multi-layer caching?

Multi-layer caching TTL best practices require tailoring expiration times to data volatility and the specific layer, ensuring Redis and CDN configurations balance data freshness against unnecessary backend load.

How do I design cache-key schemas that avoid collisions in Redis?

Design cache-key schemas in Redis to avoid collisions and stale responses by applying structured key hygiene rules that uniquely identify data variations across API responses and configuration caches.

Does stale-while-revalidate work for CDN and in-memory cache layers?

Stale-while-revalidate works for CDN and in-memory cache layers by serving expired data during background refresh, a strategy supported alongside explicit TTL and invalidation rules to maintain user trust.

When should I not use caching for API responses?

You should not use caching for API responses when data volatility is extremely high or strict real-time consistency is required, situations where complex invalidation rules and TTLs cannot guarantee correctness.