2 days ago
- Redis 6 introduces client-side caching (tracking) to improve performance by caching data on the client side.
- The feature splits the key space into about 16 million caching slots using a 24-bit CRC64 hash.
- The server maintains an invalidation table mapping slots to client IDs, using ~130MB of memory.
- When a key is modified, the server sends invalidation messages to all clients that have cached data in that slot.
- Clients can enable tracking with CLIENT TRACKING on and optionally redirect invalidation messages to a dedicated connection using REDIRECT.
- RESP3 protocol supports push messages for invalidation; RESP2 can work with redirection and Pub/Sub mode.