CacheManager icon indicating copy to clipboard operation
CacheManager copied to clipboard

[Question] Using redis both for cache and for signalR

Open macchmie3 opened this issue 4 years ago • 1 comments

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?

macchmie3 avatar Sep 30 '21 13:09 macchmie3

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

MichaCo avatar Sep 30 '21 16:09 MichaCo