redis / go-redis

Redis Go client
https://redis.uptrace.dev
BSD 2-Clause "Simplified" License
19.6k stars 2.31k forks source link

support parsing client-cache invalidation messages #3007

Open mhelmich opened 1 month ago

mhelmich commented 1 month ago

This PR adds support for parsing redis client-side caching invalidation messages. Today, these messages are not parsed properly and an error is returned instead. With this PR, messages are parsed into a Message and the array of invalidated cache key is passed to the caller inside PayloadSlice of the message. This PR does not add a cache to the client or enables the client-side caching feature. It merely plumbs invalidation messages through to the caller. A caching mechanism can (and has to) be built on top of this change.

Details about redis' client-side caching feature can be found here: https://redis.io/docs/latest/develop/use/client-side-caching/

mhelmich commented 2 weeks ago

Hi @chayim and @ofekshenawa 👋 I'm roping you into this PR because you were also part of the relevant discussion (https://github.com/redis/go-redis/discussions/2370). I'm hoping to get some traction on this PR.