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 458 forks source link

Isolation between two caches on the same redis #271

Closed amirxnz closed 5 years ago

amirxnz commented 5 years ago

We have several different types of entites we are caching. We are using SystemRuntimeCacheHandle with a redis backplane.

Most types get updated very rarely, but one type gets updated a lot.

Only a specific subset of machines handle the volatile entity, but we only have one redis cluster. What i see is happening now is that for the OnAdd, I see that even though I gave the volitile one a different redis configuration name I am getting messages for all kinds of devices. I dont want my quiet machines to get so many notifications.

Is there a way to have two totally separate caches on the same redis backplane with each only getting notifications for the entities they are caching?

Thanks!

MichaCo commented 5 years ago

I might get your usecase wrong, but the backplane's channelname should help separating the events.

Per CacheManager configuration you can specify a different channel name for the backplane. Instances of those configurations should listen to events of that channel only. Per default, they'd all use the same channel / get all events.