Skip to content

Commit 6d027b2

Browse files
committed
chore: readme
1 parent 01c86ed commit 6d027b2

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MessagingRedisCache
22

3-
[`MessagingRedisCache`](/src/MessagingRedisCache/README.md) is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs) using [`RedisCache`](https://github.com/dotnet/aspnetcore/blob/main/src/Caching/StackExchangeRedis/src/RedisCache.cs) as a base implementation. `MessagingRedisCache` will utilize [Redis pub/sub](https://redis.io/topics/pubsub) to ensure that cache entries can be synchronized in a distributed system, where direct deferral to Redis is not always performant. Because of this, it is a functional backing store for [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid) which will also evict the `IMemoryCache` entries in distributed systems.
3+
[`MessagingRedisCache`](/src/MessagingRedisCache/README.md) is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs) using [`RedisCache`](https://github.com/dotnet/aspnetcore/blob/main/src/Caching/StackExchangeRedis/src/RedisCache.cs) as a base implementation. `MessagingRedisCache` will utilize [Redis pub/sub](https://redis.io/topics/pubsub) to ensure that memory cache entries can be synchronized in a distributed system. This makes it a viable backing store for [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid), where it can evict `IMemoryCache` entries in distributed systems.
44

55
# L1L2RedisCache
66

7-
[`L1L2RedisCache`](/src/L1L2RedisCache/README.MD) is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs) with emphasis on performance. It leverages [`IMemoryCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IMemoryCache.cs) as a level 1 cache and [`MessagingRedisCache`](/src/MessagingRedisCache/README.md) as a level 2 cache, with level 1 evictions being managed via [Redis pub/sub](https://redis.io/topics/pubsub).
7+
[`L1L2RedisCache`](/src/L1L2RedisCache/README.MD) is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs), leveraging [`IMemoryCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IMemoryCache.cs) as a level 1 cache and [`MessagingRedisCache`](/src/MessagingRedisCache/README.md) as a level 2 cache. Level 1 evictions are managed via `MessagingRedisCache`'s [Redis pub/sub](https://redis.io/topics/pubsub).

src/L1L2RedisCache/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# L1L2RedisCache
22

3-
`L1L2RedisCache` is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs) with emphasis on performance. It leverages [`IMemoryCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IMemoryCache.cs) as a level 1 cache and [`MessagingRedisCache`](../MessagingRedisCache/README.md) as a level 2 cache, with level 1 evictions being managed via [Redis pub/sub](https://redis.io/topics/pubsub).
3+
`L1L2RedisCache` is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs), leveraging [`IMemoryCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IMemoryCache.cs) as a level 1 cache and [`MessagingRedisCache`](../MessagingRedisCache/README.md) as a level 2 cache. Level 1 evictions are managed via `MessagingRedisCache`'s [Redis pub/sub](https://redis.io/topics/pubsub).
44

5-
`L1L2RedisCache` is heavily inspired by development insights provided over the past several years by [StackOverflow](https://stackoverflow.com/). It attempts to simplify those concepts into a highly accessible `IDistributedCache` implementation that is more performant.
5+
`L1L2RedisCache` is heavily inspired by development insights provided over the past several years by [StackOverflow](https://stackoverflow.com/). It attempts to simplify those concepts into a highly accessible `IDistributedCache` implementation that is more performant than a baseline `RedisCache`.
66

7-
Using a [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid) combined with [`MessagingRedisCache`](../MessagingRedisCache/README.md) is a viable alternative to this project. It is possible that with the full release of `HybridCache` this project will no longer be necessary.
7+
Using a [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid) combined with [`MessagingRedisCache`](../MessagingRedisCache/README.md) is a viable alternative to this project. It is possible that with increased functionality of `HybridCache` that this project will no longer be necessary.
88

99
## Configuration
1010

@@ -20,6 +20,8 @@ services.AddL1L2RedisCache(options =>
2020
});
2121
```
2222

23+
## MessagingRedisCacheOptions
24+
2325
`L1L2RedisCache` uses `MessagingRedisCacheOptions` which extend the standard `RedisCache` [`RedisCacheOptions`](https://github.com/dotnet/aspnetcore/blob/main/src/Caching/StackExchangeRedis/src/RedisCacheOptions.cs). The following additional customizations are supported:
2426

2527
### MessagingType
@@ -34,7 +36,7 @@ The type of messaging system to use for L1 memory cache eviction.
3436

3537
## Performance
3638

37-
L1L2RedisCache will generally outperform `RedisCache`, especially in cases of high volume or large cache entries. As entries are opportunistically pulled from memory instead of Redis, costs of latency, network, and Redis operations are avoided. Respective performance gains will rely heavily on the impact of afforementioned factors.
39+
L1L2RedisCache will generally outperform a baseline `RedisCache`, particularly in cases of high volume or large cache entries. As entries are opportunistically pulled from memory instead of Redis, where costs of latency, network, and Redis operations are avoided. Respective performance gains will rely heavily on the impact of the afforementioned factors.
3840

3941
## Considerations
4042

src/MessagingRedisCache/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# MessagingRedisCache
22

3-
`MessagingRedisCache` is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs) using [`RedisCache`](https://github.com/dotnet/aspnetcore/blob/main/src/Caching/StackExchangeRedis/src/RedisCache.cs) as a base implementation. `MessagingRedisCache` will utilize [Redis pub/sub](https://redis.io/topics/pubsub) to ensure that cache entries can be synchronized in a distributed system, where direct deferral to Redis is not always performant. Because of this, it is a functional backing store for [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid) which will also evict the `IMemoryCache` entries in distributed systems.
3+
`MessagingRedisCache` is an implementation of [`IDistributedCache`](https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/IDistributedCache.cs) using [`RedisCache`](https://github.com/dotnet/aspnetcore/blob/main/src/Caching/StackExchangeRedis/src/RedisCache.cs) as a base implementation. `MessagingRedisCache` will utilize [Redis pub/sub](https://redis.io/topics/pubsub) to ensure that memory cache entries can be synchronized in a distributed system. This makes it a viable backing store for [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid), where it can evict `IMemoryCache` entries in distributed systems.
44

5-
All changes to entries in `MessagingRedisCache` by way of removal or updates, will result in a Redis message being published. The default implementation is to directly publish these messages in an established channel. Alternatively, [keyevent notifications](https://redis.io/topics/notifications) or [keyspace notifications](https://redis.io/topics/notifications) can be used if the Redis server is configured for them.
5+
All changes to entries in `MessagingRedisCache` by way of removal or updates will result in a Redis message being published. The default implementation is to directly publish these messages in an established channel. Alternatively, [keyevent notifications](https://redis.io/topics/notifications) or [keyspace notifications](https://redis.io/topics/notifications) can be used if the Redis server is configured for them.
66

7-
I expect to gracefully decomission this project when [`StackExchange.Redis`](https://github.com/StackExchange/StackExchange.Redis) has [client-side caching](https://redis.io/docs/latest/develop/use/client-side-caching/) support.
7+
I expect to gracefully decomission this project when [`StackExchange.Redis`](https://github.com/StackExchange/StackExchange.Redis) has [client-side caching](https://redis.io/docs/latest/develop/use/client-side-caching/) support or if [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid) similarly implements client-side eviction.
88

99
## Configuration
1010

11-
It is intended that `MessagingRedisCache` be used in conjunction with another kind of layered caching solution, specificially [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid) or [`L1L2RedisCache`](../L1L2RedisCache/README.md). Without any kind of layered cache solution, `MessagingRedisCache` will only publish Redis pub/sub messages for another consumer.
11+
It is intended that `MessagingRedisCache` be used in conjunction with another kind of layered caching solution, specificially [`HybridCache`](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid) or [`L1L2RedisCache`](../L1L2RedisCache/README.md). Without any kind of layered cache solution, `MessagingRedisCache` will only publish Redis pub/sub messages for another consumer unconfigured by this project.
1212

1313
`MessagingRedisCache` can be registered during startup with the following `IServiceCollection` extension method:
1414

0 commit comments

Comments
 (0)