🔴 Redis Intermediate

What is CLIENT TRACKING in Redis (client-side caching)?

Answer

Client-side caching (introduced in Redis 6) allows application-level caches that are automatically invalidated by Redis. When a client opts in with CLIENT TRACKING ON, Redis records which keys each client has read. When any of those keys are modified, Redis sends an invalidation message to the client via a dedicated invalidation channel, telling it to evict its local copy. This enables a two-tier cache: the local in-process cache (nanosecond access) backed by Redis (sub-millisecond access) without stale data risk. Two modes: default mode (Redis tracks per-connection), and broadcasting mode (Redis sends invalidations for all writes to a key prefix, simpler but higher network overhead). This is one of Redis 6's most powerful features for ultra-high-performance applications.