Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add khalilbenaz/claude-skills-collection --skill caching-strategygit clone --depth 1 https://github.com/khalilbenaz/claude-skills-collectionWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/caching-strategy)<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/caching-strategy"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/caching-strategy/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/caching-strategy"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/caching-strategy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00103 | $0.02264 |
| Opus 5 | $0.00051 | $0.01132 |
| Sonnet 5 | $0.00021 | $0.00453 |
| Haiku 4.5 | $0.00010 | $0.00226 |
Grade A, and why
caching-strategy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 224 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Caching Strategy
Workflow
1. Qualifier le besoin
Avant de cacher quoi que ce soit, répondre à ces trois questions :
| Question | Cache pertinent si… |
|---|---|
| Ratio lecture/écriture ? | Lectures >> écritures (≥ 10:1) |
| Données partagées entre instances ? | Oui → distributed cache obligatoire |
| Tolérance à la stale data ? | Si cohérence stricte requise, invalidation event-based obligatoire |
Cibles prioritaires : résultats de requêtes DB coûteuses, appels API tiers (limités en rate), calculs d'agrégation, sessions utilisateur.
2. Choisir le bon niveau de cache
Requête utilisateur
│
▼
[Browser cache] ← Cache-Control, ETag, Last-Modified
│
▼
[CDN / Edge cache] ← Cloudflare, Azure CDN, AWS CloudFront
│
▼
[Application cache] ← In-process (MemoryCache) ou distributed (Redis)
│
▼
[Database query cache] ← pg_bouncer result cache, MySQL query cache (désactivé > MySQL 8)
│
▼
[Source of truth] ← Base de données / API tierce
Règle de décision :
- Instance unique, faible volume →
MemoryCache(.NET) /caffeine(Java) / dict Python - Multi-instances / scalabilité → Redis ou Memcached
- Assets statiques / réponses HTTP entières → CDN
- API REST publique → HTTP
Cache-Control+ ETag
3. Sélectionner le pattern
| Pattern | Quand l'utiliser | Trade-off |
|---|---|---|
| Cache-aside (lazy) | Contrôle maximal, données hétérogènes | Double aller DB au premier miss |
| Read-through | Simplification du code applicatif | Complexité déportée vers le cache |
| Write-through | Cohérence forte (lecture après écriture) | Latence d'écriture augmentée |
| Write-behind | Throughput d'écriture maximal | Risque de perte de données si crash |
| Refresh-ahead | Données populaires avec TTL court | Prématuré si prédiction inexacte |
Pattern le plus courant en production : cache-aside + invalidation active sur mutation.
4. Concevoir les cache keys
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 224 lines · 103 tokens per session scan A 1faf92bb2028
caching-strategy is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (22 stars, last pushed 17d ago), licensed MIT. It adds 103 tokens to every session and 2,264 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
redis-cache-strategy
Redis caching strategy designer and reviewer. ALWAYS use when designing, reviewing, or troubleshooting Redis caching layers — cache pattern selection (cache-aside, write-through, write-behind), TTL strategy, cache stampede/penetration/avalanche prevention, hot key handling, cache-DB consistency, distributed locking…
spring-cache
Spring Cache abstraction for Spring Boot 3.x. Covers @Cacheable, @CacheEvict, @CachePut, cache managers (Caffeine, Redis, EhCache), TTL configuration, cache keys, conditional caching, and cache synchronization. USE WHEN: user mentions "spring cache", "@Cacheable", "@CacheEvict", "cache manager", "Caffeine cache"…
caching-strategies
Application caching patterns. Redis caching, in-memory caches, HTTP caching, cache invalidation strategies, cache-aside, write-through, and CDN caching. USE WHEN: user mentions "caching", "cache invalidation", "Redis cache", "HTTP cache", "CDN caching", "cache-aside", "write-through", "TTL", "stale-while-revalidate"…
api-database-redis
Redis in-memory data store patterns with ioredis and node-redis -- caching, sessions, rate limiting, pub/sub, streams, queues, transactions, cluster.
api-caching-strategies
Application-level caching strategies, HTTP caching, cache invalidation, and stampede prevention.
api-performance-api-performance
Query optimization, caching, indexing, connection pooling, async patterns.