Distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using Redis. This package was built from the source code at https://github.com/dotnet/dotnet/tree/3551975be08744f0418857c5bed8ab1545c5dd47
Install
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard | |
| Other |
README
About
Microsoft.Extensions.Caching.StackExchangeRedis provides a distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using Redis.
How to Use
To use Microsoft.Extensions.Caching.StackExchangeRedis, follow these steps:
Installation
dotnet add package Microsoft.Extensions.Caching.StackExchangeRedis
Configuration
To configure the Redis cache in your app, use the AddStackExchangeRedisCache extension method. Here's an example:
var builder = WebApplication.CreateBuilder();
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = builder.Configuration.GetConnectionString("MyRedisConStr");
options.InstanceName = "MyCache";
});
Main Types
RedisCache: Provides a distributed cache implementation using RedisRedisCacheOptions: Provides options used for configuring aRedisCache
Additional Documentation
For additional documentation and examples, refer to the official documentation on using the Distributed Redis Cache in ASP.NET Core.
Feedback & Contributing
Microsoft.Extensions.Caching.StackExchangeRedis is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.