Skip to content

Commit f69352e

Browse files
Provide Microsoft.Extensions.Caching.StackExchangeRedis package README (dotnet#57785)
1 parent 5545cff commit f69352e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## About
2+
3+
`Microsoft.Extensions.Caching.StackExchangeRedis` provides a distributed cache implementation of `Microsoft.Extensions.Caching.Distributed.IDistributedCache` using Redis.
4+
5+
## How to Use
6+
7+
To use `Microsoft.Extensions.Caching.StackExchangeRedis`, follow these steps:
8+
9+
### Installation
10+
11+
```shell
12+
dotnet add package Microsoft.Extensions.Caching.StackExchangeRedis
13+
```
14+
15+
### Configuration
16+
17+
To configure the Redis cache in your app, use the `AddStackExchangeRedisCache` extension method. Here's an example:
18+
19+
```csharp
20+
var builder = WebApplication.CreateBuilder();
21+
22+
builder.Services.AddStackExchangeRedisCache(options =>
23+
{
24+
options.Configuration = builder.Configuration.GetConnectionString("MyRedisConStr");
25+
options.InstanceName = "MyCache";
26+
});
27+
```
28+
29+
## Main Types
30+
31+
* `RedisCache`: Provides a distributed cache implementation using Redis
32+
* `RedisCacheOptions`: Provides options used for configuring a `RedisCache`
33+
34+
## Additional Documentation
35+
36+
For additional documentation and examples, refer to the [official documentation](https://learn.microsoft.com/aspnet/core/performance/caching/distributed#distributed-redis-cache) on using the Distributed Redis Cache in ASP.NET Core.
37+
38+
## Feedback & Contributing
39+
40+
`Microsoft.Extensions.Caching.StackExchangeRedis` is released as open-source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/aspnetcore).

0 commit comments

Comments
 (0)