Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 5 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,75 +119,17 @@ public class ValuesController : Controller

For more helpful information about EasyCaching, please click [here](http://easycaching.readthedocs.io/en/latest/) for EasyCaching's documentation.

## Extension Libs

- [EasyCaching.Extensions](https://github.com/yrinleung/EasyCaching.Extensions)

## Examples

See [sample](https://github.com/catcherwong/EasyCaching/tree/master/sample)

## Todo List

### Caching Providers

- [x] Memory
- [x] Redis(Based on [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis))
- [x] Redis(Based on [csredis](https://github.com/2881099/csredis))
- [x] SQLite
- [x] Memcached
- [x] Hybrid(Combine local caching and distributed caching)
- [ ] Disk
- [ ] Others...

### Basic Caching API

- [x] Get/GetAsync(with data retriever)
- [x] Get/GetAsync(without data retriever)
- [x] Set/SetAsync
- [x] Remove/RemoveAsync
- [x] Refresh/RefreshAsync
- [x] RemoveByPrefix/RemoveByPrefixAsync
- [x] SetAll/SetAllAsync
- [x] GetAll/GetAllAsync
- [x] GetByPrefix/GetByPrefixAsync
- [x] RemoveAll/RemoveAllAsync
- [x] GetCount
- [x] Flush/FlushAsync
- [x] TrySet/TrySetAsync
- [ ] Others...

### Serializer Extensions

- [x] BinaryFormatter
- [x] MessagePack
- [x] Json
- [x] ProtoBuf
- [ ] Others...

### Caching Interceptor

- [x] AspectCore
- [x] Castle
- [ ] Others ..

1. EasyCachingAble
2. EasyCachingPut
3. EasyCachingEvict

> Note: Not support Hybird Caching provider yet.

### Caching Bus

- [x] Redis (Based on [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis))
- [x] Redis (Based on [csredis](https://github.com/2881099/csredis))
- [x] RabbitMQ

### Others

- [x] Configuration
- [x] Caching Region (one region with an instance of provider)
- [x] Caching Statistics
- [ ] UI Manager
- [x] Logger
- [ ] Caching Warm Up
- [ ] ...
See [ToDo List](ToDoList.md)

## Contributing

Expand Down
65 changes: 65 additions & 0 deletions ToDoList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Todo List

## Caching Providers

- [x] Memory
- [x] Redis(Based on [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis))
- [x] Redis(Based on [csredis](https://github.com/2881099/csredis))
- [x] SQLite
- [x] Memcached
- [x] Hybrid(Combine local caching and distributed caching)
- [ ] Disk
- [ ] Others...

## Basic Caching API

- [x] Get/GetAsync(with data retriever)
- [x] Get/GetAsync(without data retriever)
- [x] Set/SetAsync
- [x] Remove/RemoveAsync
- [x] Refresh/RefreshAsync
- [x] RemoveByPrefix/RemoveByPrefixAsync
- [x] SetAll/SetAllAsync
- [x] GetAll/GetAllAsync
- [x] GetByPrefix/GetByPrefixAsync
- [x] RemoveAll/RemoveAllAsync
- [x] GetCount
- [x] Flush/FlushAsync
- [x] TrySet/TrySetAsync
- [ ] Others...

## Serializer Extensions

- [x] BinaryFormatter
- [x] MessagePack
- [x] Json
- [x] ProtoBuf
- [ ] Others...

## Caching Interceptor

- [x] AspectCore
- [x] Castle
- [ ] Others ..

1. EasyCachingAble
2. EasyCachingPut
3. EasyCachingEvict

> Note: Not support Hybird Caching provider yet.

## Caching Bus

- [x] Redis (Based on [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis))
- [x] Redis (Based on [csredis](https://github.com/2881099/csredis))
- [x] RabbitMQ

## Others

- [x] Configuration
- [x] Caching Region (one region with an instance of provider)
- [x] Caching Statistics
- [ ] UI Manager
- [x] Logger
- [ ] Caching Warm Up
- [ ] ...
46 changes: 16 additions & 30 deletions build/releasenotes.props
Original file line number Diff line number Diff line change
@@ -1,64 +1,50 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageNotes>
1. Modity diagnostics.
2. Add EasyCachingInterceptorOptions
3. Add hight availability configuration for Interceptor
1. Add GenerateDocumentationFile.
</EasyCachingCorePackageNotes>
<EasyCachingMemcachedPackageNotes>
1. Update EasyCaching.Core.
2. Remove AddDefaultMemcached related extension methods
1. Add GenerateDocumentationFile.
</EasyCachingMemcachedPackageNotes>
<EasyCachingRedisPackageNotes>
1. Update EasyCaching.Core.
2. Remove AddDefaultRedisCache related extension methods
1. Add GenerateDocumentationFile.
</EasyCachingRedisPackageNotes>
<EasyCachingSQLitePackageNotes>
1. Update EasyCaching.Core.
2. Remove AddSQLiteCache extension method
1. Add GenerateDocumentationFile.
</EasyCachingSQLitePackageNotes>
<EasyCachingInMemoryPackageNotes>
1. Update EasyCaching.Core.
2. Remove AddDefaultInMemoryCache related extension methods
3. Remove key prefix for different instance
1. Add GenerateDocumentationFile.
</EasyCachingInMemoryPackageNotes>
<EasyCachingHybridPackageNotes>
1. Update EasyCaching.Core.
2. Add distributed cache providers and local cache providers configuration.
1. Add GenerateDocumentationFile.
2. Fixed bug of Unable to resolve service for type 'EasyCaching.HybridCache.HybridCachingOptions'
</EasyCachingHybridPackageNotes>
<EasyCachingAspectCorePackageNotes>
1. Update EasyCaching.Core.
2. Add hight availability configuration
3. Add provider configuration.
1. Add GenerateDocumentationFile.
</EasyCachingAspectCorePackageNotes>
<EasyCachingCastlePackageNotes>
1. Update EasyCaching.Core.
2. Add hight availability configuration
3. Add provider Configuration.
1. Add GenerateDocumentationFile.
</EasyCachingCastlePackageNotes>
<EasyCachingResponseCachingPackageNotes>
1. Update EasyCaching.Core.
1. Add GenerateDocumentationFile.
</EasyCachingResponseCachingPackageNotes>
<EasyCachingJsonPackageNotes>
1. Update EasyCaching.Core.
2. Remove AddDefaultJsonSerializer extension method
1. Add GenerateDocumentationFile.
</EasyCachingJsonPackageNotes>
<EasyCachingMessagePackPackageNotes>
1. Update EasyCaching.Core.
2. Remove AddDefaultMessagePackSerializer extension method
1. Add GenerateDocumentationFile.
</EasyCachingMessagePackPackageNotes>
<EasyCachingProtobufPackageNotes>
1. Update EasyCaching.Core.
2. Remove AddDefaultProtobufSerializer extension method
1. Add GenerateDocumentationFile.
</EasyCachingProtobufPackageNotes>
<EasyCachingCSRedisPackageNotes>
1. Update EasyCaching.Core.
1. Add GenerateDocumentationFile.
</EasyCachingCSRedisPackageNotes>
<EasyCachingRedisBusPackageNotes>
1. Update EasyCaching.Core.
1. Add GenerateDocumentationFile.
</EasyCachingRedisBusPackageNotes>
<EasyCachingRabbitBusPackageNotes>
1. Update EasyCaching.Core.
1. Add GenerateDocumentationFile.
</EasyCachingRabbitBusPackageNotes>
</PropertyGroup>
</Project>
32 changes: 16 additions & 16 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageVersion>0.5.4</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.5.4</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.5.4</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.5.4</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.5.4</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.5.4</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.5.4</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.5.4</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.5.4</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.5.4</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.5.4</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.5.4</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>0.5.4</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>0.5.4</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>0.5.4</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>0.5.4</EasyCachingRabbitBusPackageVersion>
<EasyCachingCorePackageVersion>0.5.4.1</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.5.4.1</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.5.4.1</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.5.4.1</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.5.4.1</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.5.4.1</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.5.4.1</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.5.4.1</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.5.4.1</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.5.4.1</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.5.4.1</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.5.4.1</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>0.5.4.1</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>0.5.4.1</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>0.5.4.1</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>0.5.4.1</EasyCachingRabbitBusPackageVersion>
</PropertyGroup>
</Project>
29 changes: 26 additions & 3 deletions docs/In-Memory.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DefaultInMemoryCachingProvider

EasyCaching.InMemory is a in-memory caching lib which is based on **EasyCaching.Core** and **Microsoft.Extensions.Caching.Memory**.
EasyCaching.InMemory is a in-memory caching lib which is based on **EasyCaching.Core**.

When you use this lib , it means that you will handle the memory of current server . As usual , we named it as local caching .

Expand Down Expand Up @@ -30,8 +30,28 @@ public class Startup
//Important step for In-Memory Caching
services.AddEasyCaching(option =>
{
//use memory cache
// use memory cache with a simple way
option.UseInMemory("default");

// use memory cache with your own configuration
config.UseInMemory(options=>
{
options.DBConfig = new InMemoryCachingOptions
{
// scan time, default value is 1 min
ExpirationScanFrequency = TimeSpan.FromMinutes(1),
// 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
options.MaxRdSecond = 120;
// whether enable logging, default is false
options.EnableLogging = false;
// mutex key's alive time(ms), default is 5000
options.LockMs = 5000;
// when mutex key alive, it will sleep some time, default is 300
options.SleepMs = 300;
}, "default1");
});
}
}
Expand Down Expand Up @@ -66,6 +86,9 @@ And what we add in `appsettings.json` are as following:
"CachingProviderType": 1,
"MaxRdSecond": 120,
"Order": 2,
"DBConfig":{
"SizeLimit": 10000
}
}
}
```
Expand Down Expand Up @@ -113,4 +136,4 @@ public class ValuesController : Controller
var res = await _provider.GetAsync<string>("demo");
}
}
```
```
1 change: 1 addition & 0 deletions src/EasyCaching.Bus.CSRedis/EasyCaching.Bus.CSRedis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>
A simple caching bus(message bus) based on CSRedis.
</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Bus,Hybrid,Redis,Caching,Cache</PackageTags>
<PackageProjectUrl>https://github.com/dotnetcore/EasyCaching</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dotnetcore/EasyCaching/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>
A simple caching bus(message bus) based on RabbitMQ.
</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Bus,Hybrid,RabbitMQ,Caching,Cache</PackageTags>
<PackageProjectUrl>https://github.com/dotnetcore/EasyCaching</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dotnetcore/EasyCaching/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
1 change: 1 addition & 0 deletions src/EasyCaching.Bus.Redis/EasyCaching.Bus.Redis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>
A simple caching bus(message bus) based on StackExchange.Redis.
</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Bus,Hybrid,Redis,Caching,Cache</PackageTags>
<PackageProjectUrl>https://github.com/dotnetcore/EasyCaching</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dotnetcore/EasyCaching/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
1 change: 1 addition & 0 deletions src/EasyCaching.CSRedis/EasyCaching.CSRedis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>
A simple distributed caching provider based on csredis.
</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Redis,DistributedCache,Caching,Cache</PackageTags>
<PackageProjectUrl>https://github.com/dotnetcore/EasyCaching</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dotnetcore/EasyCaching/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
5 changes: 4 additions & 1 deletion src/EasyCaching.Core/Configurations/BaseProviderOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public class BaseProviderOptions
/// Gets or sets the max random second.
/// </summary>
/// <remarks>
/// Prevent Cache Crash
/// If this value greater then zero, the seted cache items' expiration will add a random second
/// This is mainly for preventing Cache Crash
/// </remarks>
/// <value>The max random second.</value>
public int MaxRdSecond { get; set; } = 120;
Expand All @@ -40,12 +41,14 @@ public class BaseProviderOptions

/// <summary>
/// Gets or sets the sleep ms.
/// when mutex key alive, it will sleep some time, default is 300
/// </summary>
/// <value>The sleep ms.</value>
public int SleepMs { get; set; } = 300;

/// <summary>
/// Gets or sets the lock ms.
/// mutex key's alive time(ms), default is 5000
/// </summary>
/// <value>The lock ms.</value>
public int LockMs { get; set; } = 5000;
Expand Down
1 change: 1 addition & 0 deletions src/EasyCaching.Core/EasyCaching.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>
EasyCaching is a open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Caching,Cache,Distributed,Memory,Interceptor,Hybrid,ResponseCaching</PackageTags>
<PackageProjectUrl>https://github.com/dotnetcore/EasyCaching</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dotnetcore/EasyCaching/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
1 change: 1 addition & 0 deletions src/EasyCaching.HybridCache/EasyCaching.HybridCache.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>
A simple hybrid caching provider combines local caching and distributed caching.
</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>Hybrid,Synchronization,LocalCache,DistributedCache,Caching</PackageTags>
<PackageProjectUrl>https://github.com/dotnetcore/EasyCaching</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dotnetcore/EasyCaching/blob/master/LICENSE</PackageLicenseUrl>
Expand Down
Loading