Sometimes topics can be explained a little bit more, and the following docs can help you with that.
Make yourself comfortable with FusionCache.
A complete step by step example of why a cache is useful, why FusionCache could be even more so, how to apply most of the options available and what results you can expect to obtain.
A feature comparison between existing .NET caching solutions, to help you choose which one to use.
Sometimes it's nice to be able to visualize the internal flow of a system, even more so for such a complex beast as an hybrid cache like FusionCache.
So, diagrams!
How global and entry options work in FusionCache, how to use them better and things to know.
FusionCache has a lot of features, let's see them grouped together:
- 🛡️ Cache Stampede: automatic protection from the Cache Stampede problem
- 💣 Fail-Safe: a mechanism to avoids transient failures, by reusing an expired entry as a temporary fallback
- ↩️ Auto-Recovery: self-healing for the entire cache, all automatically
- 🔀 L1+L2: any implementation of
IDistributedCache
can be used as an optional 2nd level, all transparently - 📢 Backplane: in a multi-node scenario, it can notify the other nodes about changes in the cache, so all will be in-sync
- ⏱ Soft/Hard Timeouts: a slow factory (or distributed cache) will not slow down your application, and no data will be wasted
- 🦅 Eager Refresh: start a non-blocking background refresh before the expiration occurs
- 🔂 Conditional Refresh: like HTTP Conditional Requests, but for caching
- 🚀 Background Distributed Operations: distributed operations can easily be executed in the background, safely, for better performance
- 📛 Named Caches: easily work with multiple named caches, even if differently configured
- 🏷️ Tagging: tags can be associated to entries, to later expire them all at once
- 🧼 Clear: clear an entire cache, even with shared L2, cache key prefix, etc
Ⓜ️ Microsoft HybridCache: can be used as an implementation of the new HybridCache abstraction from Microsoft, all while adding extra features- 🧙♂️ Adaptive Caching: for when you don't know upfront the entry options (eg:
Duration
), since they depends on the value being cached itself - 🔃 Dependency Injection + Builder: native support for Dependency Injection, with a nice fluent interface including a Builder support
- ♊ Auto-Clone: be sure that cached values returned can be safely modified
- 💫 Fully sync/async: native support for both the synchronous and asynchronous programming model
- 🧩 Plugins: extend FusionCache with additional behavior like adding support for metrics, statistics, etc...
- 🔭 OpenTelemetry: native observability support via OpenTelemetry
- 📜 Logging: comprehensive, structured and customizable, via the standard
ILogger
interface - 📞 Events: a comprehensive set of events, both at a high level and at lower levels (memory/distributed)