What problem does it solve?
This Skill helps you design and implement production-grade in-memory caching in Go with the samber/hot library, avoiding common mistakes that cause poor hit rates, stale data, runtime panics, and lock contention.
Core Features & Use Cases
- Algorithm Selection: Choose the right eviction strategy for the workload, from mixed-access defaults to stable frequency-heavy caches and scan-resistant patterns.
- Production Cache Setup: Configure TTL, janitor cleanup, loaders, negative caching, sharding, warm-up, copy semantics, and Prometheus metrics in the correct builder chain.
- Operational Safety: Prevent issues like missing-cache panics, invalid WithoutLocking and Janitor combinations, loader-chain misunderstandings, and unsafe mutable value handling.
- Use Case: A Go API can use this Skill to build a cache for user profiles, DNS records, product data, or configuration lookups with the right eviction policy and monitoring from the start.
Quick Start
Ask the assistant to build a samber/hot cache for your Go service with the correct eviction algorithm, TTL, janitor cleanup, and any loaders or monitoring you need.