question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`RedisCacheLayer` should not be allowed in `RedisRemoteEvictionExtension`

See original GitHub issue

See 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:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Turnerjcommented, Jun 25, 2022

Ended up implementing this the interface way with ILocalCacheLayer and IDistributedCacheLayer for v0.12.0.

1reaction
mgoodfellowcommented, Aug 13, 2021

Regarding file cache layers - you could always make it more specific for use case - LocalFileStoreCache vs DistributedFileStoreCache, and it is therefore up to the user to make it clear whether these files will be shared among readers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetOrSetAsync fails to write value to redis when any ...
I'm trying a basic redis backed setup. SetAsync works, but GetOrSetAsync is not setting the value into redis. It is setting the value...
Read more >
Key eviction
When Redis is used as a cache, it is often convenient to let it automatically evict old data as you add new data....
Read more >
Redis client handling
Note that replica and master connections aren't affected by the client eviction mechanism. Therefore, such connections are never evicted. maxmemory-clients can ...
Read more >
Evictions - Database Caching Strategies Using Redis
Evictions occur when cache memory is overfilled or is greater than the maxmemory setting for the cache, causing the engine--selecting keys to evict...
Read more >
Eviction policy | Redis Documentation Center
The eviction policy determines what happens when a database reaches its memory limit. To make room for new data, older data is evicted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found