`RedisCacheLayer` should not be allowed in `RedisRemoteEvictionExtension`
See original GitHub issueSee https://github.com/TurnerSoftware/CacheTower/issues/163#issuecomment-824094255
While the main issue is that RedisCacheLayer shouldn’t be allowed, it is reasonable to consider that no distributed caches should be allowed (though let’s be honest, would someone use a different distributed cache if they used Redis for remote eviction?).
Solution 1
Loop over the cache layers and check if any are a RedisCacheLayer (eg. cacheLayer is RedisCacheLayer). Problem with this approach is that it is in a different library and referencing it would suck.
Solution 2
Have some sort of shared IDistributedCacheLayer in the main CacheTower library and use that as the check. This avoids the problem above with the only downside that we have an interface we don’t really care about (all cache layers are treated the same otherwise).
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)

Top Related StackOverflow Question
Ended up implementing this the interface way with
ILocalCacheLayerandIDistributedCacheLayerfor v0.12.0.Regarding file cache layers - you could always make it more specific for use case -
LocalFileStoreCachevsDistributedFileStoreCache, and it is therefore up to the user to make it clear whether these files will be shared among readers.