CacheManager icon indicating copy to clipboard operation
CacheManager copied to clipboard

Feature Request: Sharing cache handles - so they store keys with same prefix

Open shahjay748 opened this issue 7 years ago • 0 comments

How can we use handle of existing ICacheManager in configuring new ICacheManager ? Currently, If we create two instance of ICacheManager and use the SystemRuntimeCacheHandle in both, it's still creates two different hanldes. Seems like you're prepending some UniqueId while storing keys, so keys are not getting shared between both instances. Is there any way of sharing cache handles - so they store keys with same prefix ?

The reason for this requirement is - when distributed cache stops working, we still want to keep our app working with memory cache and we've implemented that by referring http://michaco.net/blog/WhatIfRedisStopsWorkingHowDoIkeepMyAppRunning.

But the problem is - when we move to memory cache from distributed cache, all keys which were already there in memory cache are not accessible by separate memory cache handle.

We can fix this if somehow we can use same handle(which uses same UniqueId prefix) in both instances of CacheManager i.e. distributed and inMemory - so we don't loose access to existing memory cache when distributed cache stops.

Can you please add this feature ?

shahjay748 avatar Sep 18 '18 21:09 shahjay748