caching-strategy
Skill0 starsChanged 8 months agoMITView on GitHub
Use when implementing caching - Redis, CDN, HTTP cache headers, application-level memoization, or cache invalidation patterns
6 other projects use a version of this.
Adopted by
Most recently taken up by
- RadekCihlar/Claude-skillstheir own version, first seen Jul 10, 2026
- Sir-chawakorn/sanook-clitheir own version, first seen Jun 21, 2026
- dtsong/agentic-counciltheir own version, first seen Jun 10, 2026
- kwhorne/elyra-skillstheir own version, first seen May 22, 2026
- marcusgoll/Spec-Flowtheir own version, first seen Apr 23, 2026
- YepAPI/skillstheir own version, first seen Apr 12, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- marcusgoll/Spec-Flow★ 94same name
- Sir-chawakorn/sanook-cli★ 9same name
- YepAPI/skills★ 8same name
- kwhorne/elyra-skills★ 1same name
- RadekCihlar/Claude-skills★ 1same name
- dtsong/agentic-council★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository190 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-auditSkill
- accessibility-complianceSkill
- ado-api-cliSkill
- ado-artifactsSkill
- ado-container-deploymentsSkill
- ado-organizationSkill
- ado-pipeline-designSkill
- ado-pipeline-optimizationSkill
- ado-pipeline-securitySkill
- ado-pipelines-opsSkill
- ado-release-managementSkill
- ado-security-policiesSkill
- ado-work-trackingSkill
- adr-writingSkill
- agentic-ai-patternsSkill
- agentic-evalSkill
- agentic-memorySkill
- agentic-reliabilitySkill
- agentic-securitySkill
- ai-data-moatSkill
- ai-harnessSkill
- ai-product-designSkill
- ai-product-monetizationSkill
- ai-product-positioningSkill
- ai-product-retentionSkill
- ai-product-validationSkill
- ai-safety-guardrailsSkill
- add-analytics-instrumentationSkill
- analyze-account-healthSkill
- analyze-ai-topicsSkill
- analyze-chartSkill
- analyze-dashboardSkill
- analyze-experimentSkill
- analyze-feedbackSkill
- compare-user-journeysSkill
- create-chartSkill
- create-dashboardSkill
- daily-briefSkill
- debug-replaySkill
- diagnose-errorsSkill
- diff-intakeSkill
- discover-analytics-patternsSkill
- discover-event-surfacesSkill
- discover-opportunitiesSkill
- instrument-eventsSkill
- investigate-ai-sessionSkill
- monitor-ai-qualitySkill
- monitor-reliabilitySkill
- replay-ux-auditSkill
- review-agent-insightsSkill
- taxonomySkill
- weekly-briefSkill
- what-would-lenny-doSkill
- analytics-reportingSkill
- api-contract-testingSkill
- api-designSkill
- authentication-patternsSkill
- blockchain-auditSkill
- brainstormingSkill
- The first 60 shown.
The file
Files
Caching Strategy
Overview
Caching trades freshness for speed. The hard part isn't adding a cache — it's invalidating it correctly.
Core principle: Cache at the right layer, with the right TTL, and a clear invalidation strategy.
When to Use
- Slow API responses that serve repeated data
- High database load from identical queries
- Static assets delivery optimization
- Reducing third-party API calls
Cache Layers (top to bottom)
| Layer | TTL | Best For |
| CDN (Cloudflare, CloudFront) | Hours-days | Static assets, public pages |
| HTTP cache (browser) | Minutes-hours | API responses, images |
| Application cache (Redis/Memcached) | Seconds-minutes | DB query results, computed data |
| In-process (memoization) | Request lifetime | Expensive computations within a request |
Cache-Aside Pattern (most common)
1. Check cache for key
2. Cache hit → return cached value
3. Cache miss → fetch from source, store in cache, returnInvalidation Strategies
| Strategy | How | Use When |
| TTL expiry | Set expiration time | Data can be slightly stale |
| Write-through | Update cache on every write | Strong consistency needed |
| Event-driven | Invalidate on data change event | Microservices, async systems |
| Cache tags | Tag entries, purge by tag | Related data changes together |
HTTP Cache Headers
# Immutable static assets (hashed filenames)
Cache-Control: public, max-age=31536000, immutable
# API responses (revalidate)
Cache-Control: private, max-age=0, must-revalidate
ETag: "abc123"
# No caching
Cache-Control: no-storeAnti-Patterns
| Pattern | Problem |
| Cache everything | Stale data bugs, memory waste |
| No TTL | Cache grows forever |
| Cache without invalidation plan | Stale data served indefinitely |
| Caching user-specific data in shared cache | Data leaks between users |
| Cache stampede | All caches expire simultaneously → DB overload |
Redis Quick Reference
SET user:123 '{"name":"..."}' EX 300 # 5 min TTL
GET user:123
DEL user:123 # InvalidateIntegration
- magic-powers:performance-optimization — identify what to cache via profiling
- magic-powers:infrastructure-review — review cache infrastructure
- magic-powers:database-optimization — reduce DB load with query caching
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

