Caching Strategies
CDN, Redis, in-memory cache, cache invalidation, and distributed caching patterns
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill caching-strategiesgit clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills.git /tmp/mercury-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/mercury-agent-skills/categories/backend/caching-strategies ~/.claude/skills/caching-strategiesPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Caching Strategies Cache effectively to improve performance and reduce load. ## Cache Layers | Layer | Latency | Storage | Examples | |-------|---------|---------|----------| | Browser | Local | Small | localStorage, HTTP cache | | CDN | Regional | Large | CloudFront, CloudFlare, Fastly | | Application | In-process | Small | L1 cache (heap) | | Distributed | Network | Large | Redis, Memcached | | Database | Same host | Very large | Buffer pool, query cache | ## Caching Patterns ### Cache-Aside (Lazy Loading) ``` 1. Check cache → miss 2. Query database 3. Store in cache 4. Return ``` Best for: Read-heavy, general purpose. ### Write-Through ``` 1. Write to cache 2. Cache writes to DB (sync) 3. Return ``` Best for: Consistency critical, write-heavy. ### Write-Behind ``` 1. Write to cache 2. Return immediately 3. Cache writes to DB (async) ``` Best for: High throughput writes, eventual consistency OK. ### Refresh-Ahead - Cache proactively refreshes before expiry - Reduces latency spikes on cache miss - Requires predictive logic or scheduled refresh ## Cache Invalidation **Two hard things**: naming, cache invalidation, off-by-one errors. | Strategy | How | Risk | |----------|-----|------| | TTL | Expire after X seconds | Stale data during TTL | | Event-based | Invalidate on data change | Missed events | | Version keys | `user_42_v3` | Unused old keys accumulate | | Write-through | Update cache on write | Write amplification | ## Redis Patterns
Details
- Skill name
caching-strategies- Repository
- cosmicstack-labs/mercury-agent-skills
- Path
categories/backend/caching-strategies/SKILL.md- License
- MIT
- Repo updated
- 25 August 2026
FAQ
What does the Caching Strategies skill do?
CDN, Redis, in-memory cache, cache invalidation, and distributed caching patterns
How do I install the Caching Strategies skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add cosmicstack-labs/mercury-agent-skills --skill caching-strategies. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Caching Strategies popular?
It lives in cosmicstack-labs/mercury-agent-skills, which has 492 GitHub stars and 68 forks.
Related skills
Accessibility
492cosmicstack-labs/mercury-agent-skills
Achieve and maintain WCAG compliance through inclusive design practices, proper ARIA usage, and comprehensive testing methodologies.
Accessibility Testing
492cosmicstack-labs/mercury-agent-skills
WCAG 2.1/2.2 audit, axe, Lighthouse, manual testing, screen reader testing, and remediation
Agent Audit Logging
492cosmicstack-labs/mercury-agent-skills
Implement comprehensive audit logging and reporting for multi-agent systems. Covers event capture, structured logging, traceability, compliance reporting, forensic analysis, and real-time monitoring dashboards for agent actions and decisions.
Clean Code
492cosmicstack-labs/mercury-agent-skills
Principles and practices for writing readable, maintainable, and testable code
Authentication Authorization
492cosmicstack-labs/mercury-agent-skills
JWT, OAuth2, SAML, session management, RBAC, ABAC, and MFA implementation
Cloud Architecture
492cosmicstack-labs/mercury-agent-skills
Multi-cloud, VPC design, high availability, disaster recovery, and cost optimization
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.