<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a" -->

---
title: Client-side caching in go-redis: Fewer round trips
description: go-redis can serve repeated reads from application memory using Redis server-assisted client-side caching, enabled with a ClientSideCacheConfig and Protocol 3....
canonical: https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Client-side caching in go-redis: Fewer round trips | daily.dev
og:description: go-redis can serve repeated reads from application memory using Redis server-assisted client-side caching, enabled with a ClientSideCacheConfig and Protocol 3....
og:url: https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a
og:image: https://api.daily.dev/og/posts/Mvazclh6a.png
og:image:alt: Client-side caching in go-redis: Fewer round trips
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Client-side caching in go-redis: Fewer round trips

**[Redis](https://daily.dev/sources/redislabs)** · 8 min read · 0 upvotes · 0 comments

## Summary

go-redis can serve repeated reads from application memory using Redis server-assisted client-side caching, enabled with a ClientSideCacheConfig and Protocol 3. In a benchmark of 99% GETs and 1% SETs with 64 callers, read throughput rose from 150,289 to 4,909,979 reads/s, which is 32.7x. Median read latency fell from 418.82 µs to 0.63 µs. The workload is nearly ideal for caching. The cache is sharded and shared across the connection pool, with tracking on each connection. Reads can be briefly stale until an invalidation arrives, so consistency is not immediate. Scripts, blocking commands, pipelines and transactions skip the cache.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://redis.io/blog/fewer-round-trips-faster-reads-client-side-caching-in-go-redis>

## Questions this post answers

### How do I enable client-side caching in go-redis?

Set Protocol to 3 and pass a ClientSideCacheConfig, for example with MaxEntries set to 10,000, when calling redis.NewClient. You keep using the same commands, such as Get. go-redis uses Redis command metadata to pick eligible reads like GET, MGET, HGET and HGETALL, while scripts, blocking commands, pipelines and transactions take the uncached path.

_Developers tuning Go and Redis performance follow changes like this on daily.dev._

### How much faster is go-redis with client-side caching enabled?

In a benchmark against Redis 7.4.4 with go-redis v9.23.0, 64 concurrent callers and 99% GETs, read throughput rose from 150,289 to 4,909,979 reads/s, a 32.7x gain. Median read latency dropped from 418.82 µs to 0.63 µs. The workload was nearly ideal for caching, so real-world gains will be smaller.

_Engineers weighing Redis caching strategies compare results like these on daily.dev._

### Is Redis client-side caching in go-redis strongly consistent?

No. There is a window between a value changing in Redis and go-redis processing the invalidation, and a read in that window can return the older value. If a tracking connection is lost, go-redis evicts the entries that depend on it, and fetches from Redis when it cannot confirm a cached answer is still covered.

_Teams reasoning about cache staleness trade-offs keep up with them on daily.dev._

## Similar posts on daily.dev

- [Redis Performance Tuning: Practical Techniques for High Throughput and Low Latency](https://daily.dev/posts/redis-performance-tuning-practical-techniques-for-high-throughput-and-low-latency-izsgp3dz6) · C\# Corner · 1 upvotes · 0 comments
- [Why We Chose Rust over Go for Our New Caching Layer](https://daily.dev/posts/why-we-chose-rust-over-go-for-our-new-caching-layer-mnzbcrfmj) · Medium · 47 upvotes · 7 comments
- [Redis 8.8 performance improvements: Faster string, hash, streams, SCAN & more](https://daily.dev/posts/redis-8-8-performance-improvements-faster-string-hash-streams-scan-more-r1i57y9jy) · Redis · 2 upvotes · 0 comments
- [Issue \#607: Comparing six Go cache designs — Go Weekly](https://daily.dev/posts/issue-607-comparing-six-go-cache-designs-go-weekly-fsv6lgymj) · Golang Weekly · 8 upvotes · 0 comments
- [How Uber Serves over 150 Million Reads per Second from Integrated Cache](https://daily.dev/posts/how-uber-serves-over-150-million-reads-per-second-from-integrated-cache-mjlsygxjr) · ByteByteGo · 218 upvotes · 5 comments

---

Tags: [#golang](https://daily.dev/tags/golang), [#redis](https://daily.dev/tags/redis)

[View this post on daily.dev](https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Client-side caching in go-redis: Fewer round trips","url":"https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a"},"datePublished":"2026-11-30T23:03:52.191Z","dateModified":"2026-11-30T23:04:19.608Z","description":"go-redis can serve repeated reads from application memory using Redis server-assisted client-side caching, enabled with a ClientSideCacheConfig and Protocol 3....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/94b35d7a3b9193b8f3a0b07214a6c180?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/94b35d7a3b9193b8f3a0b07214a6c180?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Redis","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Redis","logo":"https://media.daily.dev/image/upload/s--hr1KV229--/f_auto/v1729434313/logos/redis.png","url":"https://daily.dev/sources/redislabs"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"golang,redis","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Redis","item":"https://daily.dev/sources/redislabs"},{"@type":"ListItem","position":3,"name":"Client-side caching in go-redis: Fewer round trips"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/client-side-caching-in-go-redis-fewer-round-trips-mvazclh6a#faq","mainEntity":[{"@type":"Question","name":"How do I enable client-side caching in go-redis?","acceptedAnswer":{"@type":"Answer","text":"Set Protocol to 3 and pass a ClientSideCacheConfig, for example with MaxEntries set to 10,000, when calling redis.NewClient. You keep using the same commands, such as Get. go-redis uses Redis command metadata to pick eligible reads like GET, MGET, HGET and HGETALL, while scripts, blocking commands, pipelines and transactions take the uncached path. Developers tuning Go and Redis performance follow changes like this on daily.dev."}},{"@type":"Question","name":"How much faster is go-redis with client-side caching enabled?","acceptedAnswer":{"@type":"Answer","text":"In a benchmark against Redis 7.4.4 with go-redis v9.23.0, 64 concurrent callers and 99% GETs, read throughput rose from 150,289 to 4,909,979 reads/s, a 32.7x gain. Median read latency dropped from 418.82 µs to 0.63 µs. The workload was nearly ideal for caching, so real-world gains will be smaller. Engineers weighing Redis caching strategies compare results like these on daily.dev."}},{"@type":"Question","name":"Is Redis client-side caching in go-redis strongly consistent?","acceptedAnswer":{"@type":"Answer","text":"No. There is a window between a value changing in Redis and go-redis processing the invalidation, and a read in that window can return the older value. If a tracking connection is lost, go-redis evicts the entries that depend on it, and fetches from Redis when it cannot confirm a cached answer is still covered. Teams reasoning about cache staleness trade-offs keep up with them on daily.dev."}}]}
```

