EasyCaching alternatives and similar packages
Based on the "Caching" category.
Alternatively, view EasyCaching alternatives based on common mentions on social networks and blogs.
-
Electron.NET
:electron: Build cross platform desktop apps with ASP.NET Core (Razor Pages, MVC, Blazor). -
CacheManager
CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features. -
Akavache
An asynchronous, persistent key-value store created for writing desktop and mobile applications, based on SQLite3. Akavache is great for both storing important data as well as cached local data that expires. -
Lazy Cache
An easy to use thread safe in-memory caching service with a simple developer friendly API for c# -
FusionCache
FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features. -
Shiny for Microsoft Application UI (MAUI), Xamarin Forms, Xamarin Native, & Blazor WebAssembly
.NET Framework for Backgrounding & Device Hardware Services (iOS, Android, & Catalyst) -
CacheCow
An implementation of HTTP Caching in .NET Core and 4.5.2+ for both the client and the server -
SharpRepository
C# Generic Repository for use with Entity Framework, RavenDB and more with built-in caching options. -
FastCache
7x-10x faster alternative to MemoryCache. A high-performance, lighweight (8KB dll) and thread-safe memory cache for .NET. -
Green Donut
DISCONTINUED. Green Donut is a port of facebook's DataLoader utility, written in C# for .NET Core and .NET Framework
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of EasyCaching or a related project?
README
[](media/easycaching-icon.png?raw=true)
EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easily!
CI Build Status
Platform | Build Server | Master Status | Dev Status |
---|---|---|---|
Github Action | Linux/Windows |
Nuget Packages
Package Name | Version | Downloads |
---|---|---|
EasyCaching.Core | ||
EasyCaching.InMemory | ||
EasyCaching.Redis | ||
EasyCaching.Memcached | ||
EasyCaching.SQLite | ||
EasyCaching.HybridCache | ||
EasyCaching.CSRedis | ||
EasyCaching.Interceptor.Castle | ||
EasyCaching.Interceptor.AspectCore | ||
EasyCaching.Serialization.MessagePack | ||
EasyCaching.Serialization.Json | ||
EasyCaching.Serialization.Protobuf | ||
EasyCaching.Bus.RabbitMQ | ||
EasyCaching.Bus.Redis | ||
EasyCaching.Bus.CSRedis | ||
EasyCaching.ResponseCaching | ||
EasyCaching.Disk | ||
EasyCaching.LiteDB | ||
EasyCaching.Serialization.SystemTextJson |
Basic Usages
Step 1 : Install the package
Choose caching provider that you need and install it via Nuget.
Install-Package EasyCaching.InMemory
Install-Package EasyCaching.Redis
Install-Package EasyCaching.SQLite
Install-Package EasyCaching.Memcached
Step 2 : Configure Startup class
Each caching provider has it's own configuration options.
Here is a sample configuration for InMemory and Redis caching provider.
public class Startup
{
//...
public void ConfigureServices(IServiceCollection services)
{
//configuration
services.AddEasyCaching(options =>
{
//use memory cache that named default
options.UseInMemory("default");
// // use memory cache with your own configuration
// options.UseInMemory(config =>
// {
// config.DBConfig = new InMemoryCachingOptions
// {
// // scan time, default value is 60s
// ExpirationScanFrequency = 60,
// // total count of cache items, default value is 10000
// SizeLimit = 100
// };
// // the max random second will be added to cache's expiration, default value is 120
// config.MaxRdSecond = 120;
// // whether enable logging, default is false
// config.EnableLogging = false;
// // mutex key's alive time(ms), default is 5000
// config.LockMs = 5000;
// // when mutex key alive, it will sleep some time, default is 300
// config.SleepMs = 300;
// }, "m2");
//use redis cache that named redis1
options.UseRedis(config =>
{
config.DBConfig.Endpoints.Add(new ServerEndPoint("127.0.0.1", 6379));
}, "redis1")
.WithMessagePack()//with messagepack serialization
;
});
}
}
Step 3 : Write code in your controller
[Route("api/[controller]")]
public class ValuesController : Controller
{
// //when using single provider
// private readonly IEasyCachingProvider _provider;
//when using multiple provider
private readonly IEasyCachingProviderFactory _factory;
public ValuesController(
//IEasyCachingProvider provider,
IEasyCachingProviderFactory factory
)
{
//this._provider = provider;
this._factory = factory;
}
[HttpGet]
public string Handle()
{
//var provider = _provider;
//get the provider from factory with its name
var provider = _factory.GetCachingProvider("redis1");
//Set
provider.Set("demo", "123", TimeSpan.FromMinutes(1));
//Set Async
await provider.SetAsync("demo", "123", TimeSpan.FromMinutes(1));
}
}
Documentation
Detailed EasyCaching documentation can be found here.
Extension Libs
Examples
See sample
Todo List
See [ToDo List](docs/ToDoList.md)
Contributing
Pull requests, issues and commentary!
License
*Note that all licence references and agreements mentioned in the EasyCaching README section above
are relevant to that project's source code only.