-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement client side caching #521
base: master
Are you sure you want to change the base?
Conversation
Can someone review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given not everyone will be using caching and in fact redis 6 for some time, I'm wondering if this should be implemented by a separate sub package?
This would ensure we don't bloat the core pool code with features not everyone will use or want.
What do you think?
@stevenh Great idea. I'm a little embarrassed I haven't thought of that before I started trying to fit more code into |
d62ccb8
to
6f8b898
Compare
Didn't mean to close this, but fine. Take a look at now @stevenh |
* panic with actual predefined error
* Use LRU cache with TTL support
* Put key's TTL in local cache * Use pipelining to save RTT * Improve tests running time
* And some other minor improvements
OK, I've gave up on trying to come up with abstraction for caching other data types. It's too much work for potentially useless feature:
@stevenh Can this be merged with it's current feature set? |
Just a quick note to say I haven't had chance to look at this yet, hopefully soon |
This PR implements server-assisted client side caching introduced in Redis 6.0
This is done entirely at a pool level by running a separate goroutine that subscribes to invalidation broadcasts.Command responses are, again, cached by middleware at a pool level.
This is done via new Cacher struct in redisx package.
TODO:
closes #513