Agent skill · Databases

caching-patterns

Redis caching strategies, cache invalidation, write-through/write-behind, TTL management, and cache stampede protection.

vibeevalgithub.com/vibeevalGitHub ↗
claude-codeMIT
Install
npx skills add vibeeval/vibecosystem --skill caching-patterns --agent claude-code

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

Facts
Files in the skill folder: 1
SKILL.md size: 8 KB
Bundled scripts: none
Path: skills/caching-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 521
Language: C#

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

From the SKILL.md

# Caching Patterns Redis-based caching strategies for reducing latency and database load. ## Cache Key Design ```typescript // Namespace:entity:id format const CacheKeys = { market: (id: string) => `market:v1:${id}`, marketList: (filters: string) => `market:list:${filters}`, user: (id: string) => `user:v1:${id}`, userMarkets: (userId: string, page: number) => `user:${userId}:markets:${page}`, leaderboard: () => 'leaderboard:v1:global' } // Version prefix allows instant cache bust on schema change: // bump v1 → v2 to invalidate all market keys without scanning ``` ## Cache-Aside (Lazy Loading) ```typescript import Redis from 'ioredis' const redis = new Redis(process.env.REDIS_URL!) const DEFAULT_TTL = 300 // 5 minutes async function getOrSet<T>( key: string, loader: () => Promise<T>, ttl = DEFAULT_TTL ): Promise<T> { const cached = await redis.get(key) if (cached) return JSON.parse(cached) as T const value = await loader() await redis.setex(key, ttl, JSON.stringify(value)) return value } // Usage async function getMarket(id: string): Promise<Market> { return getOrSet( CacheKeys.market(id), () => db.market.findUniqueOrThrow({ where: { id } }), 300 ) } ``` ## Write-Through Pattern ```

What's inside
Steps it walks through
  1. Cache Key Design
  2. Cache-Aside (Lazy Loading)
  3. Write-Through Pattern
  4. Write-Behind (Write-Back) Pattern
  5. Cache Stampede Protection
  6. Multi-Level Caching (L1 Memory + L2 Redis)
  7. Event-Based Cache Invalidation
  8. Cache Warming
  9. Monitoring Cache Health
  10. Common Pitfalls
More from vibecosystem
All skills →
About this skill
What does the caching-patterns skill do?

Redis caching strategies, cache invalidation, write-through/write-behind, TTL management, and cache stampede protection.

How do I install it?

Run `npx skills add vibeeval/vibecosystem --skill caching-patterns --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 vibeeval/vibecosystem, a repository with 521 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