What problem does it solve?
Go services often pay latency and backend load penalties when repeatedly querying data that is hot in production. This Skill provides a robust in-memory cache using samber/hot with TTL, multiple eviction policies, loader chains, sharding, and observability to accelerate common paths.
Core Features & Use Cases
- Nine eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO) with TTL, loaders, and singleflight.
- Support for stale-while-revalidate, missing-key caching, and optional Prometheus metrics for monitoring.
- Sharding, copy-on-read/copy-on-write, and optional warm-up or preloading patterns for production readiness.
- Use case: caching high-traffic API responses, config lookups, or database queries to dramatically reduce backend pressure.
Quick Start
Instantiate a hot cache with a 10_000 capacity, a 5-minute TTL, janitor enabled, and a loader chain to demonstrate miss handling.