Agent skill · Databases

caching-strategies

CDN, Redis, in-memory cache, cache invalidation, and distributed caching patterns

Cosmic Stack3,294★ · 2 repos on radarProfile →
claude-codeMIT
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill caching-strategies --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 1.0.0
Declared author: cosmicstack-labs
Path: categories/backend/caching-strategies/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 364
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

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 | |----------|-----|---

What's inside
Steps it walks through
  1. Cache Layers
  2. Caching Patterns
  3. Cache-Aside (Lazy Loading)
  4. Write-Through
  5. Write-Behind
  6. Refresh-Ahead
  7. Cache Invalidation
  8. Redis Patterns
More from mercury-agent-skills
All skills →
About this skill
What does the caching-strategies skill do?

CDN, Redis, in-memory cache, cache invalidation, and distributed caching patterns

How do I install it?

Run `npx skills add cosmicstack-labs/mercury-agent-skills --skill caching-strategies --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From cosmicstack-labs/mercury-agent-skills, a repository with 364 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going