This skill empowers Claude to design and implement sophisticated in-memory caching strategies for Go applications using the samber/hot library. It provides expert guidance on selecting between nine distinct eviction algorithms—including W-TinyLFU, S3FIFO, and ARC—based on specific workload access patterns. Beyond basic storage, the skill handles production-critical patterns such as read-through loaders with singleflight deduplication, TTL jitter to prevent thundering herds, Prometheus metrics integration, and memory-safe capacity sizing, making it essential for optimizing high-concurrency Go services.
主要功能
01Support for 9 eviction algorithms including W-TinyLFU, S3FIFO, LRU, and ARC
02Advanced TTL management with background janitors, jitter, and stale-while-revalidate
03Built-in Prometheus metrics integration for real-time hit rate and latency monitoring
04Automated read-through loaders with singleflight deduplication to prevent cache stampedes
051,998 GitHub stars
06Thread-safe implementation with optional sharding and copy-on-read/write for mutable data
使用场景
01Optimizing microservice performance with memory-budgeted working set caches
02Reducing database latency by caching medium-to-low cardinality resources at high frequency
03Implementing robust session or configuration caching with automatic background refresh