MichaCo / CacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
http://cachemanager.michaco.net
Apache License 2.0
2.34k stars 457 forks source link

How to change redis connection while it's working? #252

Open rebulanyum opened 5 years ago

rebulanyum commented 5 years ago

Hello @MichaCo .

I was wondering if it's possible to change the redis backplane while using the CacheManager? Suppose that the CacheManager instance is a static readonly instance in my code. And I'm using that instance with specific redis backplane configuration (ip, port, password, dbid). What if I wanted to change the password? Or, what if I wanted to change the ip&port (I may prefer to change the redis instance for caching) or even dbid? Can I make these changes on CacheManager while not wiping out the local inmemory cache but only wiping out redis backplane?

Best regards.

MichaCo commented 5 years ago

Hi @rebulanyum, Great question. CacheManager currently doesn't support any feature to re-configure the Redis connection. Although there is already a wrapper around the Multiplexer object, I never added that as a feature. For the backplane, that might be a little bit more tricky because of the long running "subscribe" connection.

But yeah, would be a good addition, I'll add that as a feature request.

p3365 commented 5 years ago

This may be a blocker stopping my organisation using Cache Manager. Our web application is a long running application and downtime is expensive for our customers.