Caching in Go: An In-Memory TTL Cache, sync.Map and singleflight

· PixelsTech · Nov. 24, 2026, 6:21 a.m.
Summary
This blog post discusses the implementation of an in-memory cache in Go, focusing on key techniques such as using sync.Map and singleflight to handle concurrent requests efficiently. It provides practical insights for working with caches, especially in high-load scenarios, and emphasizes simplicity and efficiency in the design.