
samber/hot — In-memory Caching for Go
from cc-skills-golang995
Guidance and patterns for using samber/hot in Go: eviction algorithms, TTL, loaders, sharding, stale-while-revalidate, and Prometheus monitoring.
What it does
Practical, opinionated guidance for using the samber/hot in-memory caching library in Go projects. Covers algorithm selection (W-TinyLFU, LRU, LFU, TinyLFU, ARC, TwoQueue, SIEVE, FIFO), TTL strategies, loader/read-through patterns with singleflight deduplication, capacity sizing, janitor/cleanup, and Prometheus metrics. Includes code examples for basic cache usage, loader patterns, and operational best practices.
When to use it
Use this skill when your Go service imports github.com/samber/hot or when you repeatedly load the same medium-to-low cardinality resources at high frequency and need to reduce latency and backend pressure. Helpful during performance tuning, architecting cache layers, or adding observability to caches.
What's included
- Scripts: none in this skill (has_scripts=false)
- References: algorithm guide, production patterns, API reference included under references/ (has_references=true)
- Instructions: algorithm decision matrix, capacity-sizing walkthrough, loader/read-through examples, common mistakes and best practices, Prometheus integration notes.
Compatible agents
Designed for coding-capable agents (Claude Code, Copilot-style code assistants) and developers using Go 1.22+.
Tags
Information
- Repository
- cc-skills-golang
- Stars
- 995
- Installs
- 0