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.33k stars 456 forks source link

[Question] Using redis both for cache and for signalR #358

Closed macchmie3 closed 1 year ago

macchmie3 commented 2 years ago

Hi, I was wondering if in the followin scenario I would break any of the functionalities of CacheManager when using Redis.

Lets assume I have multiple instances of an application that use CacheManager with following setup:

CacheFactory.Build(settings =>
                {
                    settings.WithSerializer(typeof(GzJsonCacheSerializer))
                        .WithUpdateMode(CacheUpdateMode.Up)
                        .WithMaxRetries(3)
                        .WithMicrosoftMemoryCacheHandle("InMemoryCache")
                        .WithExpiration(ExpirationMode.Absolute, TimeSpan.FromMinutes(1))
                        .And
                        .WithRedisConfiguration("RedisCache", "ConnectionStringHere")
                        .WithRedisBackplane("RedisCache")
                        .WithRedisCacheHandle("RedisCache")
                        .WithExpiration(ExpirationMode.Absolute, TimeSpan.FromMinutes(15));
                });

I would like to use the same Redis Server for signalR purposes - it also works based on Pub/Sub mechanism, but does not store any data.

I assume everything will work correctly as cacheManager and signalR would use different channels of Redis server. Am I correct?

MichaCo commented 2 years ago

I assume everything will work correctly as cacheManager and signalR would use different channels of Redis server. Am I correct?

I would assume so, too. yes. I'm pretty sure SignalR's Redis implementation uses a named channel and doesn't listen to everything, Same as my stuff does, so, it shouldn't cause any interference