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/87bc0b04e21d786669142109a5128c95618b75ed
$ dotnet add package Microsoft.Extensions.Caching.StackExchangeRedisMicrosoft.Extensions.Caching.StackExchangeRedis provides a distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using Redis.
To use Microsoft.Extensions.Caching.StackExchangeRedis, follow these steps:
dotnet add package Microsoft.Extensions.Caching.StackExchangeRedis
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";
});
RedisCache: Provides a distributed cache implementation using RedisRedisCacheOptions: Provides options used for configuring a RedisCacheFor additional documentation and examples, refer to the official documentation on using the Distributed Redis Cache in ASP.NET Core.
Microsoft.Extensions.Caching.StackExchangeRedis is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.