What problem does it solve?
This Skill helps you design effective in-memory caching with samber/hot in Go so you reduce latency and backend pressure while handling TTL expiration, loader failures, and monitoring.
Core Features & Use Cases
- Eviction algorithm selection: Choose the right eviction strategy (e.g., W-TinyLFU, LRU, LFU, ARC, S3FIFO, SIEVE) based on access patterns such as mixed recency/frequency, stable frequency, or scan-heavy workloads.
- Production-ready cache behavior: Configure TTL, jitter, singleflight loader deduplication via loaders, stale-while-revalidate, missing key caching, sharding, and copy-on-read/write for mutable values.
- Observability and operational safety: Enable Prometheus metrics, plan for janitor/cleanup, and avoid common runtime pitfalls like missing cache configuration for SetMissing.
Quick Start
Use the golang-samber-hot skill to set up a samber/hot cache with W-TinyLFU, a 10-minute TTL, background janitor cleanup, and a loader that batches database lookups on cache misses.