What problem does it solve?
This Skill helps you design reliable in-memory caching in Go using samber/hot, preventing slowdowns from repeated medium-to-low cardinality lookups and reducing backend pressure.
Core Features & Use Cases
- Eviction algorithm selection: Choose eviction strategies like LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, and FIFO based on access patterns (and avoid common mismatches).
- Correct expiration behavior: Configure TTL, jitter, background janitor cleanup, and stale-while-revalidate so cached data stays fresh.
- Production-grade miss handling: Use loaders with built-in singleflight deduplication, loader chains, missing-key (negative) caching, and safe concurrency patterns (copy-on-read/write) with observability via Prometheus.
Quick Start
Use the golang-samber-hot skill to set up a samber/hot cache with W-TinyLFU, TTL plus WithJanitor, loader-based read-through with WithLoaders, and Prometheus metrics for a cache name like user_cache.