caching

Design caching strategies with TTL, invalidation, and selection criteria.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill caching-iceflower
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caching
Source: https://github.com/iceflower/opencode-agents-and-skills/tree/main/skills/caching
Command: npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill caching-iceflower

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenges of slow application performance and excessive resource usage by providing clear guidelines on implementing effective caching strategies.

Core Features & Use Cases

  • Cache Strategy Selection: Guides on when and where to implement caching (local, distributed, HTTP).
  • TTL Design: Provides recommendations for Time-To-Live values based on data types.
  • Invalidation Patterns: Details on Write-Through, Evict on Write, and Event-Based invalidation.
  • Anti-Patterns: Highlights common mistakes to avoid in caching implementations.
  • Use Case: Improve the response time of a frequently accessed user profile API by implementing a distributed cache with appropriate TTL and invalidation on user data updates.

Quick Start

Apply the caching skill to design a cache strategy for frequently read, rarely written data.

Frequently Asked Questions about caching

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

FAQPage Schema
How do I design a distributed cache strategy for read-heavy workloads?

Design a distributed cache strategy by applying framework-agnostic guidelines for cache placement, TTL design, and invalidation patterns. This approach optimizes performance for read-heavy workloads and expensive computations while ensuring data consistency.

What are the most common caching anti-patterns to avoid?

Common caching anti-patterns involve improper cache placement, incorrect eviction policies, and flawed invalidation logic. Avoiding these mistakes ensures data consistency, reduces latency, and prevents stale data from degrading application performance.

When should I use write-through versus event-based cache invalidation?

Use write-through invalidation for immediate consistency on data updates, while event-based invalidation suits distributed environments needing asynchronous synchronization. Selecting the correct pattern prevents stale data and reduces latency.

What is the best way to determine TTL values for different data types?

The best way to determine TTL values is by matching the cache expiration time to the specific data type's update frequency. Framework-agnostic TTL design recommendations prevent serving stale data while maximizing cache hit rates.

Does this caching approach work for local and HTTP caching scenarios?

Yes, this framework-agnostic approach provides selection criteria for implementing local, distributed, and HTTP caching. It guides cache placement to ensure optimal performance across various application layers and data access patterns.