https://github.com/furkandeveloper/easycache
This library contains more than one cache provider for dotnet.
https://github.com/furkandeveloper/easycache
auto-cache cache cache-management controller-cache dotnet dotnet-core easy-cache easy-caching easycache memcached memory-cache nuget redis response-caching
Last synced: 8 months ago
JSON representation
This library contains more than one cache provider for dotnet.
- Host: GitHub
- URL: https://github.com/furkandeveloper/easycache
- Owner: furkandeveloper
- License: mit
- Created: 2020-05-26T20:37:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-14T23:58:28.000Z (about 3 years ago)
- Last Synced: 2025-07-08T01:26:10.760Z (8 months ago)
- Topics: auto-cache, cache, cache-management, controller-cache, dotnet, dotnet-core, easy-cache, easy-caching, easycache, memcached, memory-cache, nuget, redis, response-caching
- Language: C#
- Homepage: https://furkandeveloper.github.io/EasyCache/
- Size: 132 KB
- Stars: 34
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://www.codefactor.io/repository/github/furkandeveloper/easycache)








[](https://codeclimate.com/github/furkandeveloper/EasyCache/maintainability)
[](https://opensource.org/licenses/MIT)
# EasyCache
Hi, this library contains more than one cache provider.
Thus, you can easily change the provider in your applications without re-implementation.
## Give a Star 🌟
If you liked the project or if EasyCache helped you, please give a star.
# How to use EasyCache?
EasyCache includes one more than cache provider. Choose any.
## EasyCache for MemoryCache
Install `EasyCache.Memory` from [Nuget Package](https://www.nuget.org/packages/EasyCache.Memory)
Add `services.AddEasyMemoryCache()` in startup.cs
```csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddEasyMemoryCache(); <-- Initialize EasyCache for MemoryCache
}
```
after get `IEasCacheService` from dependency injection.
```csharp
private readonly IEasyCacheService easyCacheService;
public DefaultController(IEasyCacheService easyCacheService)
{
this.easyCacheService = easyCacheService;
}
```
## EasyCache for Redis
Install `EasyCache.Redis` from [Nuget Package](https://www.nuget.org/packages/EasyCache.Redis)
Add `services.AddEasyRedisCache()` in startup.cs
```csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddEasyRedisCache(options=>
{
options.Configuration = "localhost";
options.InstanceName = GetType().Assembly.GetName().Name
}); <-- Initialize EasyCache for Redis
}
```
after get `IEasCacheService` from dependency injection.
```csharp
private readonly IEasyCacheService easyCacheService;
public DefaultController(IEasyCacheService easyCacheService)
{
this.easyCacheService = easyCacheService;
}
```
## EasyCache for MemCache
Install `EasyCache.MemCache` from [Nuget Package](https://www.nuget.org/packages/EasyCache.MemCache)
Add `services.AddEasyRedisCache()` in startup.cs
```csharp
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddEasyMemCache(options=>options.AddServer("localhost",11211)); <-- Initialize EasyCache for MemCache
}
```
after get `IEasCacheService` from dependency injection.
```csharp
private readonly IEasyCacheService easyCacheService;
public DefaultController(IEasyCacheService easyCacheService)
{
this.easyCacheService = easyCacheService;
}
```
See for more information [Wiki](https://github.com/furkandeveloper/EasyCache/wiki)
## Support
If you are having problems, please let us know by [raising a new issue](https://github.com/furkandeveloper/EasyCache/issues/new/choose).

## Star History
[](https://star-history.com/#furkandeveloper/EasyCache&Date)