Conversation
|
May I suggest to take a look at FusionCache as a different option (creator here)? It's has the same design, has been battle-tested in production for years and has more features including:
and more, you can see a list in the repo's README. Specifically about the challenges you highlighted about HybridCache:
FusionCache does: it has both
FusionCache does, via Adaptive Caching (also take a look at Conditional Refresh, it may be interesting).
FusionCache does, via multiple Named Caches, usable both via On top of this, it's also possible to use FusionCache as an implementation of HybridCache (with more features), including using them both directly in the same app at the same time, also including being able to use multiple HybridCache instances via keyed services (which is something the the Microsoft-provided HybridCache implementation can't do currently). Hope this helps. |
|
@jodydonetti Thank you for your suggestion. Personal Opinion: I'm very impressed with the featureset of FusionCache and if I was building an application, I would certainly consider using FusionCache. However, Duende.AccessTokenManagement is a library and we try to limit the number of external dependencies whenever possible. While I would love it it if the interface of HybridCache was richer, it's interface is 'good enough' for our current proposal. I'm considering creating a sample that actually demonstrates how using the FusionCache adapter for HybridCache brings a more capable implementation for our consumers. |
Thanks, appreciate it.
Makes sense, I suggested it since you have a couple of specific needs that cannot be covered with HybridCache.
That would be something appreciated! If you need anything let me know. |
ATM now uses HybridCache, including the ability to use DI to use a custom instance of HybridCache.
Before, we were writing things into IDistributedCache. Some of our clients want more direct control over where (and how) to write cache entries. For example, you may want to encrypt access tokens before they are written to a distributed cache.
We looked into several approaches for this, such as #134.
However, now that HybridCache is introduced in .net 9 (and it's also usable in .net 8), we can use this functionality as well.
There are some challenges with using HybridCache:
GetAsynctoHybridCachedotnet/extensions#5688There are 2 options:
fixes: #50