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 cosmicstack-labs/mercury-agent-skills --skill caching-strategiesgit clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skillsWrote 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/cosmicstack-labs/mercury-agent-skills/caching-strategies)<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/caching-strategies"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/caching-strategies/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/cosmicstack-labs/mercury-agent-skills/caching-strategies"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/caching-strategies.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.00023 | $0.00499 |
| Opus 5 | $0.00012 | $0.00249 |
| Sonnet 5 | $0.00005 | $0.00100 |
| Haiku 4.5 | $0.00002 | $0.00050 |
Grade A, and why
caching-strategies 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 11d 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.
What it actually says
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 |
|---|---|---|
| TTL | Expire after X seconds | Stale data during TTL |
| Event-based | Invalidate on data change | Missed events |
| Version keys | user_42_v3 |
Unused old keys accumulate |
| Write-through | Update cache on write | Write amplification |
Redis Patterns
- Use
EXPIREon every SET - Use
SCANnotKEYSin production - Distributing: Redis Cluster for sharding
- Backup: RDB (snapshot) + AOF (append-only log)
- Monitor: hit rate, memory, evictions, latency
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.
- 11d ago First seen · 74 lines · 23 tokens per session scan A 19a7d6e021a2
caching-strategies is a skill published in the GitHub repository cosmicstack-labs/mercury-agent-skills (470 stars, last pushed 17d ago), licensed MIT. It adds 23 tokens to every session and 499 once invoked, about $0.0001 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-08-30.
Other skills, from other repositories
google-cloud-storage-fuse
Mounts Cloud Storage buckets as a POSIX file system with Cloud Storage FUSE (gcsfuse). Use when interacting with gcsfuse: decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute Engine, or Cloud Run, enable and size file, stat, and list caches, tune…
aws-cloudformation-elasticache
Provides AWS CloudFormation patterns for ElastiCache Redis or Memcached infrastructure, including subnet groups, parameter groups, security controls, and cross-stack outputs. Use when designing cache tiers, high-availability replication groups, encryption settings, or reusable CloudFormation templates for application…
spring-boot-cache
Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator. Use when adding caching to Spring Boot services, configuring…
hermes-mnemosyne
Mnemosyne is Hermes' primary local-first memory engine — SQLite with vector + FTS5 hybrid search, 19+ tools, auto-consolidation, and a standalone CLI. It's a pip-installed plugin (not a built-in toolset) discovered via $HERMESHOME/plugins/mnemosyne/.
loom-caching
Caching strategies for performance optimization — cache-aside, write-through, write-behind, TTL policies, eviction, and stampede prevention.
edge-serverless-db-expert
Expert guide for Serverless & Edge Databases (Neon Serverless Postgres, Cloudflare D1, Turso/libsql, Upstash Redis), cold-start mitigation, and connection pooling / Panduan ahli database Serverless & Edge (Neon, Cloudflare D1, Turso, Upstash).