{"id":13408090,"url":"https://github.com/MichaCo/CacheManager","last_synced_at":"2025-03-14T12:32:07.904Z","repository":{"id":29146371,"uuid":"32676553","full_name":"MichaCo/CacheManager","owner":"MichaCo","description":"CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.","archived":false,"fork":false,"pushed_at":"2024-08-09T14:34:27.000Z","size":6622,"stargazers_count":2345,"open_issues_count":64,"forks_count":456,"subscribers_count":159,"default_branch":"dev","last_synced_at":"2024-10-29T15:33:55.960Z","etag":null,"topics":["c-sharp","cache","cachemanager","caching","dotnet","dotnet-core","memcached","redis"],"latest_commit_sha":null,"homepage":"http://cachemanager.michaco.net","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MichaCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"MichaCo"}},"created_at":"2015-03-22T13:25:13.000Z","updated_at":"2024-10-24T17:21:12.000Z","dependencies_parsed_at":"2023-01-14T14:14:44.143Z","dependency_job_id":"be9403c9-ea0e-4274-99b9-dcc85efa430d","html_url":"https://github.com/MichaCo/CacheManager","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FCacheManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FCacheManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FCacheManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaCo%2FCacheManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaCo","download_url":"https://codeload.github.com/MichaCo/CacheManager/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318758,"owners_count":20272144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","cache","cachemanager","caching","dotnet","dotnet-core","memcached","redis"],"created_at":"2024-07-30T20:00:50.681Z","updated_at":"2025-03-14T12:32:07.882Z","avatar_url":"https://github.com/MichaCo.png","language":"C#","readme":"CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.\n\nThe main goal of the CacheManager package is to make developer's life easier to handle even very complex caching scenarios.  \nWith 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.\n\nCacheManager 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... \nThe developer can opt-in to those features only if needed.\n\n## Build Status\n\nBranch | Status\n--- | :---:\nDev | [![Build Status](https://dev.azure.com/michaco/CacheManager/_apis/build/status%2FMichaCo.CacheManager?branchName=dev)](https://dev.azure.com/michaco/CacheManager/_build/latest?definitionId=3\u0026branchName=dev)\nMaster | [![Build Status](https://dev.azure.com/michaco/CacheManager/_apis/build/status%2FMichaCo.CacheManager?branchName=master)](https://dev.azure.com/michaco/CacheManager/_build/latest?definitionId=3\u0026branchName=master)\n\n## CacheManager Nuget Packages\n\n| Package Name | FullFramework | .NET Standard | net8.0 |\n| -------------- | :-------: | :-------: | :-------: | \n| [CacheManager.Core][Core.nuget] | 4.7.2 | 2.0 | net8.0 |\n| [CacheManager.Microsoft.Extensions.Caching.Memory][MSCache.nuget]  | - | 2.0 | net8.0 |\n| [CacheManager.Microsoft.Extensions.Configuration][Configuration.nuget]  | - | 2.0 | net8.0 |\n| [CacheManager.Serialization.Bond][Bond.nuget]  | - | 2.0 | net8.0 |\n| [CacheManager.Serialization.DataContract][DataContract.nuget]  | - | 2.0 | net8.0 |\n| [CacheManager.Serialization.Json][Json.nuget]  | - | 2.0 | net8.0 |\n| [CacheManager.Serialization.ProtoBuf][ProtoBuf.nuget]  | - | 2.0 | net8.0 |\n| [CacheManager.StackExchange.Redis][Redis.nuget] | 4.7.2 | 2.0 | net8.0 |\n| [CacheManager.SystemRuntimeCaching][SystemRuntimeCaching.nuget]  | 4.7.2 | 2.0 | net8.0 |\n\n## Version 2.0 Breaking Changes\n\n* CacheManager.Microsoft.Extensions.Logging is not a separated package anymore. Logging is now part of the Core package.\n* CacheManager.Memcached is not supported anymore\n* CacheManager.Couchbase is not supported anymore\n* CacheManager.Web is not supported anymore\n* PerformanceCounters are not available for now\n\n### Testing with Microsoft.Garnet\n\nFor testing and benchmarking, this project is now using Microsoft.Garnet, which allows to create a Redis server which runs in process and is easy to setup.\nThis has some limitations though and before you use Microsoft.Garnet in production, be aware that for example key space notifications are not supported yet.\n\nSee https://github.com/microsoft/garnet for details.\n\n## Beta Packages\nBeta versions of the CacheManager packages are getting pushed to https://www.myget.org/gallery/cachemanager on each build. \nAdd the following feed, if you want to play with the not yet released bits: \n\n    https://www.myget.org/F/cachemanager/api/v3/index.json\n\nTo find which check-in created which build, use this [build history](https://ci.appveyor.com/project/MichaCo/cachemanager-ak9g3/history).\n\n## Documentation\n \nDocumentation can be found on [cachemanager.michaco.net][cmweb]:\n\n* [**Getting Started**][gettingstarted]\n* [**Configuration**][configuration]\n* [**Features and Architecture**][featuresarticle]\n* [**Update Operations**][updatearticle]\n* [**Serialization**][serialization]\n* [**Cache Synchronization**][cachesyncarticle]\n* [**Logging**][logging]\n\nGenerated [**API documentation**][help] is also available.\n\n## Blog Posts\n\nCacheManager related blog posts can be found on [my website](http://michaco.net/blog?tag=CacheManager)\n\n## Examples\n* Examples included in the Cache Manager repository\n\t* [**Some usage examples**][program.cs]\n\t* [**Sample ASP.NET Core website**][corewebsample]\n* [**Single Page Todo App with Cache Manager on Azure using Redis**][todosample]\n\n## Benchmarks\nSee [benchmarks results](https://github.com/MichaCo/CacheManager/blob/dev/Benchmarks.md) on GitHub.\n\n## List of Features\n\n* One common interface for handling different caching technologies: `ICache\u003cT\u003e`\n* Configurable by\n\t* Code with many different paths and a fluent configuration builder\n\t* Microsoft.Extensions.Configuration\n\t* App/Web.config\n\t* See [configuration docs][configuration]\n* Support for different cache providers\n    * **MemoryCache** (System.Runtime.Caching)\n\t* **MemoryCache** based on Microsoft.Extensions.Caching.Memory\n    * **Redis** using [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis)\n* **Serialization** can now be configured.\nSerialization is only needed in distributed caches. If no additional serialization package is installed and configured, Binary serialization will be used (if available)\nThe following are the currently available serialization options:\n\t* Binary (build in if the full CLR is being used)\n\t* **Json** based on the popular Newtonsoft.Json library\n\t* **Json** with Gzip compression\n    * **Bond** based on Microsoft.Bond supporting all three available variants\n    * **DataContract** based on System.Runtime.Serialization library supporting binary, Json \u0026 Json with Gzip compression\n\t* **Protocol Buffer** Google's protobuf. The package uses Mark's [protobuf-net](https://github.com/mgravell/protobuf-net) implementation.\n* **Update values with lock or transaction** for distributed caches. \nThe interfaced provides a simple update method which internally ensures you work with the latest version.\nAnd CacheManager handles version conflicts for you.\n* **Logging** using Microsoft.Extensions.Logging.\n* **Strongly typed** cache interface.\n* **Multiple layers**\nBy having multiple cache handles managed by CacheManager, you can easily implement layered caches. For example, an in process cache in front of your distributed cache, to make read access faster.\nCacheManager will synchronize those layers for you. \n    * `Put` and `Add` operations will always be executed on all cache handles registered on the manager.\n    * On `Get`, there are different configuration options defined by `CacheUpdateMode`, if the item was available in one cache handle:\n        * None: No update across the cache handles on Get\n        * Up: Updates the handles \"above\"\n        * All: Updates/Adds the item to all handles\n* **Expiration**: It is possible to configure the expiration per cache handle within the manager or per cache item.\nThe following are the supported expiration modes:\n    * Sliding expiration: On cache hit, the cache item expiration timeout will be extended by the configured amount.\n    * Absolute expiration: The cache item will expire after the configured timeout.\n    * Since 1.0.0, evictions triggered by the cache vendor can trigger events and updates\n* **Cache Regions**: Even if some cache systems do not support or implement cache regions, the CacheManager implements the mechanism.\nThis can be used to for example group elements and remove all of them at once.\n* **Statistics**: Counters for all kind of cache actions.\n* **Event System**: CacheManager triggers events for common cache actions:\nOnGet, OnAdd, OnPut, OnRemove, OnClear, OnClearRegion\n   * Events also get triggered by the backplane (if enabled) when multiple instances are sharing the same cache.\n   * New `OnRemoveByHandle` events triggered by actual expiration or memory pressure eviction by the cache vendor\n   * Events also get triggered through the backplane and via Redis keyspace events (if configured)\n* **Cache clients synchronization** \n    * Implemented with the Redis pub/sub feature\n\n[releases]: https://github.com/MichaCo/CacheManager/releases\n[Core.nuget]: https://www.nuget.org/packages/CacheManager.Core\n[Redis.nuget]: https://www.nuget.org/packages/CacheManager.StackExchange.Redis \n[SystemRuntimeCaching.nuget]: https://www.nuget.org/packages/CacheManager.SystemRuntimeCaching\n[AppFabricCache.nuget]: https://www.nuget.org/packages/CacheManager.AppFabricCache\n[WindowsAzureCaching.nuget]: https://www.nuget.org/packages/CacheManager.WindowsAzureCaching\n[Memcached.nuget]: https://www.nuget.org/packages/CacheManager.Memcached\n[Web.nuget]: https://www.nuget.org/packages/CacheManager.Web\n[Couchbase.nuget]: https://www.nuget.org/packages/CacheManager.Couchbase\n[mcweb]: http://michaco.net\n[cmweb]:  http://cachemanager.michaco.net\n[articles]: https://github.com/MichaCo/CacheManager/tree/master/Articles\n[help]: http://cachemanager.michaco.net/Documentation/api\n[gettingstarted]: http://cachemanager.michaco.net/Documentation/CacheManagerGettingStarted\n[configuration]: http://cachemanager.michaco.net/Documentation/CacheManagerConfiguration\n[featuresarticle]: http://cachemanager.michaco.net/Documentation/CacheManagerArchitecture\n[updatearticle]: http://cachemanager.michaco.net/Documentation/CacheManagerUpdateOperations\n[cachesyncarticle]: http://cachemanager.michaco.net/Documentation/CacheManagerCacheSynchronization\n[logging]: http://cachemanager.michaco.net/Documentation/CacheManagerLogging\n[serialization]: http://cachemanager.michaco.net/Documentation/CacheManagerSerialization\n[program.cs]: https://github.com/MichaCo/CacheManager/blob/master/samples/CacheManager.Examples/Program.cs\n[corewebsample]: https://github.com/MichaCo/CacheManager/tree/dev/samples/AspnetCore.WebApp\n[todosample]: http://michaco.net/blog/SinglePageTodoAppwithCacheManager\n[Json.nuget]: https://www.nuget.org/packages/CacheManager.Serialization.Json\n[Logging.nuget]: https://www.nuget.org/packages/CacheManager.Microsoft.Extensions.Logging\n[Configuration.nuget]: https://www.nuget.org/packages/CacheManager.Microsoft.Extensions.Configuration\n[MSCache.nuget]: https://www.nuget.org/packages/CacheManager.Microsoft.Extensions.Caching.Memory\n[ProtoBuf.nuget]: https://www.nuget.org/packages/CacheManager.Serialization.ProtoBuf\n[Bond.nuget]: https://www.nuget.org/packages/CacheManager.Serialization.Bond\n[DataContract.nuget]: https://www.nuget.org\n","funding_links":["https://github.com/sponsors/MichaCo"],"categories":["Frameworks, Libraries and Tools","Caching","缓存","dotnet","C# #","Libraries","Libraries, Frameworks and Tools","框架, 库和工具","C\\#","🗒️ Cheatsheets"],"sub_categories":["Caching","缓存","📦 Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMichaCo%2FCacheManager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMichaCo%2FCacheManager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMichaCo%2FCacheManager/lists"}