Implement client side caching #521
Conversation
|
Can someone review? |
stevenh
left a comment
There was a problem hiding this comment.
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