You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our caching configuration uses both in-memory cache and Redis. Additionally we rely on Redis keyspace notifications to clear keys from the in-memory caches across all our app service instances.
One problem we are having is something bad gets into the cache, we want to flush redis and also flush in-memory cache on all instances. Is this possible? Does ICacheManager.Clear propagage the cache clear to clear in-memory cache on all instances?
Assuming it doesn't, I was thinking we could use a region that contains all our cache items so we can clear the region to clear Redis and all the instance caches in one go. Is it possible to prefix all our regions with a global region name? My testing indicates that each cache item can only belong to one region and there is no concept of multiple regions or region prefixes.
If I create items in regions called "ALL:regionone", "ALL:regiontwo"
// This works as expected:
_cacheManager.DeleteRegion("ALL:regionone");
// Didn't 100% expect this to work, but this does not clear any of my items:
_cacheManager.DeleteRegion("ALL");
Any advice greatly appreciated!
David
The text was updated successfully, but these errors were encountered:
I just tried it out some tests again and your Clear action is being propagated with Redis between my 2 test instances - apologies for the false alarm!
So that's my main problem fixed :)
I guess I'm just wondering if you can confirm is there any way to have more than 1 region or region prefix associated with a cached item?
Our caching configuration uses both in-memory cache and Redis. Additionally we rely on Redis keyspace notifications to clear keys from the in-memory caches across all our app service instances.
One problem we are having is something bad gets into the cache, we want to flush redis and also flush in-memory cache on all instances. Is this possible? Does ICacheManager.Clear propagage the cache clear to clear in-memory cache on all instances?
Assuming it doesn't, I was thinking we could use a region that contains all our cache items so we can clear the region to clear Redis and all the instance caches in one go. Is it possible to prefix all our regions with a global region name? My testing indicates that each cache item can only belong to one region and there is no concept of multiple regions or region prefixes.
If I create items in regions called "ALL:regionone", "ALL:regiontwo"
// This works as expected:
_cacheManager.DeleteRegion("ALL:regionone");
// Didn't 100% expect this to work, but this does not clear any of my items:
_cacheManager.DeleteRegion("ALL");
Any advice greatly appreciated!
David
The text was updated successfully, but these errors were encountered: