caching-strategy
Skill1 starsChanged 33 days agoMITView on GitHub
Design and review caching (Redis, Memcached, CDN, HTTP and in-process caches) — what to cache, keys and invalidation, TTLs, stampede protection, per-user data isolation and failure behaviour. Use when adding a cache to fix latency or load, or when stale data, cache stampedes or data leaks between users appear.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- AtulPurohit/Antigravity-Awesome-Skillstheir own version, first seen Nov 29, 2026
- afine907/skillstheir own version, first seen Nov 29, 2026
- vindreshsingh/engineering-skillstheir own version, first seen Oct 20, 2026
- Jinbae10/skillstheir own version, first seen Jul 7, 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
- YepAPI/skills★ 8same name
- AtulPurohit/Antigravity-Awesome-Skills★ 6same name
- afine907/skills★ 1same name
- Jinbae10/skills★ 0same name
- vindreshsingh/engineering-skills★ 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 repository105 other files it gives its agents.
- AGENTS.mdAGENTS.md
- instructions/AGENTS.mdAGENTS.md
- accessibility-reviewSkill
- agent-evaluationSkill
- agent-guardrailsSkill
- agenthub-routerSkill
- ai-red-teamingSkill
- ansible-reviewSkill
- api-designSkill
- api-integrationSkill
- architecture-decisionSkill
- backup-restoreSkill
- chaos-engineeringSkill
- ci-cd-pipeline-designSkill
- cloud-cost-optimizationSkill
- cloud-iam-least-privilegeSkill
- code-reviewSkill
- container-image-optimizationSkill
- cyber-resilience-actSkill
- database-migrationsSkill
- data-pipeline-reviewSkill
- data-privacySkill
- data-quality-checksSkill
- debugging-root-causeSkill
- dependency-auditSkill
- dependency-upgradeSkill
- disaster-recovery-drillSkill
- docker-hardeningSkill
- documentationSkill
- dora-readinessSkill
- dpiaSkill
- email-deliverabilitySkill
- embedding-model-selectionSkill
- error-handling-reviewSkill
- eu-ai-act-readinessSkill
- eu-data-sovereigntySkill
- european-accessibility-actSkill
- event-driven-architectureSkill
- feature-flagsSkill
- frontend-reviewSkill
- gdpr-dsar-handlingSkill
- github-actionsSkill
- gitlab-ciSkill
- git-workflowSkill
- go-developmentSkill
- graphql-api-reviewSkill
- helm-chart-reviewSkill
- i18n-localizationSkill
- incident-responseSkill
- java-spring-reviewSkill
- kubernetes-reviewSkill
- linux-server-hardeningSkill
- llm-cost-analysisSkill
- llm-gateway-routingSkill
- llm-observabilitySkill
- llm-output-evaluationSkill
- llm-structured-extractionSkill
- load-testingSkill
- local-llm-servingSkill
- log-analysisSkill
- The first 60 shown.
The file
Files
Caching Strategy
Goal
A cache that measurably reduces latency or load, never serves one user's data to another, and degrades gracefully when it fails.
Inputs
- Latency and load measurements, read/write ratio, data freshness requirements, data sensitivity, cache technology and topology.
Procedure
- Justify: measure the expensive operation and its hit pattern first; caching hides problems that indexes or query fixes would solve better.
- Choose the layer: HTTP caching (
Cache-Control,ETag) and CDN for public content; shared cache (Redis) for computed results shared across instances; in-process cache for small, hot, immutable data. - Keys: include every input that changes the result — tenant, user or permission scope, locale, version. Missing a dimension is a data leak.
- Freshness: TTLs based on how stale data may be; explicit invalidation on writes (delete-on-write, versioned keys); document the consistency guarantee you accept.
- Stampede protection: request coalescing or locks for recomputation, TTL jitter, stale-while-revalidate for expensive keys.
- Sizing and eviction: memory limits and eviction policy (for example
allkeys-lru) chosen deliberately; monitor hit ratio, evictions and memory. - Failure behaviour: timeouts on cache calls; on cache failure fall back to the source with protection (rate limits) rather than failing requests; avoid making the cache a hidden single point of failure.
- Security: authentication and TLS for networked caches; no public exposure; sensitive values encrypted or not cached;
Cache-Control: private, no-storefor personal responses at the HTTP layer.
Example fixture
GET /api/me/dashboard cached in CDN for 60 s with key = URL path only.Expected findings: personal dashboard cached under a shared key — users see each other's data; must be private/no-store or keyed by user at the application cache.
Acceptance checks
- Hit ratio and latency measured before and after, with the same workload.
- Negative case: two users requesting the same personalised endpoint receive their own data (test through the full cache path).
- Cache outage test: the service stays available within agreed degraded latency.
Output
Cache design (layer, keys, TTL, invalidation), measurements, configuration and tests.
Safety
Flushing production caches can overload the database; schedule with approval and monitoring. Never expose cache ports publicly.
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.

