Proposal - Pluggable cache abstraction#142
Open
Hawxy wants to merge 12 commits into
Open
Conversation
c221cd0 to
2678cc4
Compare
cbrady
reviewed
Apr 29, 2026
cbrady
reviewed
Apr 29, 2026
cbrady
reviewed
May 18, 2026
|
|
||
| [Test] | ||
| public void BackgroundCleanup_RemovesExpiredItems() | ||
| public async Task BackgroundCleanup_RemovesExpiredItems() |
Contributor
There was a problem hiding this comment.
i don't think this test is valid anymore, i think it's passing because we can't determine if the background task removed the item or Get's lazy eviction did.
Contributor
Author
There was a problem hiding this comment.
If that's the case it was always broken, right? Get previously had the lazy logic.
cbrady
reviewed
May 18, 2026
Contributor
|
this is looking good, one more thing. would you be able to update the readme? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hiya,
I'm looking at building some more advanced abstractions around this package in order to automate feature tracking & checking in ASP.NET Core, but at the moment this package doesn't integrate well with the wider ecosystem.
Like many modern .NET projects, we already have a L1 + L2 + Backplane caching solution via FusionCache, and I'd prefer to reuse all of that infrastructure to keep our nodes in sync as it's far less chatty than a pure redis cache. At the moment there isn't an easy to way to swap out the caching implementation globally, and so that's what I've proposed here.
The main change is the cache abstraction is provided as a non-generic interface and reused where required, rather than having a cache per-type which doesn't scale well.
The existing
RedisCachealso had a few issues that've been fixed as part of this:ConnectionMultiplexeris designed to be created once for the life of an application and reused where needed, not created per-cache. Projects that are already using Redis will have a pre-configured Multiplexer and libraries typically let users provide one rather than dealing with the Redis connection themselves, so most of the connection options have been made obsolete.Edit: I did another pass at the configuration options and aligned them with Microsoft's own Redis options for flexibility & familiarity.