Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESP3 doesn't work well with server assisted client caching #178

Open
killwort opened this issue Feb 25, 2024 · 3 comments
Open

RESP3 doesn't work well with server assisted client caching #178

killwort opened this issue Feb 25, 2024 · 3 comments

Comments

@killwort
Copy link

When using RESP3 protocol RedisClient does not receive invalidation messages. That breaks client side caching completely. However, PubSub functionality works well with RESP3, so I suspect that client side cache subscribes wrong connection to the invalidations.
To reproduce you may use your net8_clietn example with just adding RESP3 to connection string. The program will not receive invalidation messages as it does in RESP2(default) mode.

@2881099
Copy link
Owner

2881099 commented Feb 27, 2024

see https://redis.io/docs/manual/client-side-caching/

When RESP3 is used instead, invalidation messages are sent (either in the same connection, or in the secondary connection when redirection is used) as push messages (read the RESP3 specification for more information).

The document does not have a demonstration of RESP3.

@killwort
Copy link
Author

killwort commented Feb 27, 2024

https://github.com/TheUniversalCity/RedisClient
this library implements server assisted caching on top of RESP3, so it is practically possible (however it has its own problems, like lack of SSL support and bad fault tolerance). The socket in RESP3 mode is only connected once and used in full duplex mode.

@2881099
Copy link
Owner

2881099 commented Feb 27, 2024

Invalidation messages are sent in the same connection (only available when the RESP3 protocol is used) or redirected in a different connection (available also with RESP2 and Pub/Sub).

From the description, RESP2 is more suitable for Invalidation messages.

RESP2 dual connection, using Client Tracking on REDIRECT ID, only needs to subscribe once to "__ redis__: validate".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants