go-redis implements server-assisted client-side caching
The author explains the implementation of server-assisted client-side caching in go-redis, which stores repeated reads in application memory while using Redis tracking to handle stale entries. Benchmarks on an Apple M4 Max showed that enabling the cache increased read throughput by 32.7 times and reduced median read latency to under a microsecond under an ideal read-heavy workload. The library uses a sharded cache shared across the connection pool to balance memory efficiency and lock contention. Open article →