Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-14T23:58:28.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T15:41:57.559Z (2 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: 3
- 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
[![CodeFactor](https://www.codefactor.io/repository/github/furkandeveloper/easycache/badge)](https://www.codefactor.io/repository/github/furkandeveloper/easycache)
![Nuget](https://img.shields.io/nuget/dt/EasyCache.Core?label=EasyCache.Core%20Downloads)
![Nuget](https://img.shields.io/nuget/v/EasyCache.Core?label=EasyCache.Core)
![Nuget](https://img.shields.io/nuget/dt/EasyCache.Memory?label=EasyCache.Memory%20Downloads)
![Nuget](https://img.shields.io/nuget/v/EasyCache.Memory?label=EasyCache.Memory)
![Nuget](https://img.shields.io/nuget/dt/EasyCache.Redis?label=EasyCache.Redis%20Downloads)
![Nuget](https://img.shields.io/nuget/v/EasyCache.Redis?label=EasyCache.Redis)
![Nuget](https://img.shields.io/nuget/dt/EasyCache.MemCache?label=EasyCache.MemCache%20Downloads)
![Nuget](https://img.shields.io/nuget/v/EasyCache.MemCache?label=EasyCache.MemCache)
[![Maintainability](https://api.codeclimate.com/v1/badges/c84fe2700fb04bf913f6/maintainability)](https://codeclimate.com/github/furkandeveloper/EasyCache/maintainability)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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).
![Alt](https://repobeats.axiom.co/api/embed/dd389955d475338637f2be8512b227262616c41b.svg "Repobeats analytics image")
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=furkandeveloper/EasyCache&type=Date)](https://star-history.com/#furkandeveloper/EasyCache&Date)