CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
The main goal of the CacheManager package is to make developer’s life easier to handle even very complex caching scenarios.
With CacheManager it is possible to implement multiple layers of caching, e.g. in-process caching in front of a distributed cache, in just a few lines of code.
CacheManager is not just an interface to unify the programming model for various cache providers, which will make it very easy to change the caching strategy later on in a project. It also offers additional features, like cache synchronization, concurrent updates, serialization, events, performance counters…
The developer can opt-in to those features only if needed.
Build Server | Status |
---|---|
Windows, MSBuild | |
Linux, Mono | - |
Package Name | FullFramework | .NET Standard |
---|---|---|
CacheManager.Core | 4.5 | 2.0 |
CacheManager.StackExchange.Redis | 4.6.1 | 2.0 |
CacheManager.SystemRuntimeCaching | 4.5 | 2.0 |
CacheManager.Microsoft.Extensions.Caching.Memory | (4.6.1) | 2.0 |
CacheManager.Microsoft.Extensions.Configuration | 4.6.1 | 2.0 |
CacheManager.Microsoft.Extensions.Logging | (4.6.1) | 2.0 |
CacheManager.Serialization.DataContract | 4.5 | 2.0 |
CacheManager.Serialization.Bond | 4.5 | 2.0 |
CacheManager.Serialization.Json | 4.5 | 2.0 |
CacheManager.Serialization.ProtoBuf | 4.5 | 2.0 |
CacheManager.Web | 4.5 | - |
CacheManager.Memcached | 4.5 | - |
CacheManager.Couchbase | 4.5 | 2.0 |
Supported framework targets changed since CacheManager 2.0. In case you have to target .NET 40 for example, you can still use CacheManager 1.x!
Beta versions of the CacheManager packages are getting pushed to https://www.myget.org/gallery/cachemanager on each build.
Add the following feed, if you want to play with the not yet released bits:
https://www.myget.org/F/cachemanager/api/v3/index.json
To find which check-in created which build, use this build history.
Documentation can be found on cachemanager.michaco.net:
Generated API documentation is also available.
CacheManager related blog posts can be found on my website
See benchmarks results on GitHub.
ICache<T>
Put
and Add
operations will always be executed on all cache handles registered on the manager.Get
, there are different configuration options defined by CacheUpdateMode
, if the item was available in one cache handle:
perfmon
, CacheManager supports performance counters per instance of the manager and per cache handle.OnRemoveByHandle
events triggered by actual expiration or memory pressure eviction by the cache vendor