Differences between Microsoft.Extensions.Cashing.Redis and Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache

前端 未结 1 1661
慢半拍i
慢半拍i 2021-01-17 16:22

I am a little bit lost. I am reading Microsoft documentation for ASP.NET Core caching using Redis. And the documentation suggests to use Microsoft.Extensions.Caching.StackEx

相关标签:
1条回答
  • 2021-01-17 16:38

    A look at the dependency graph for Microsoft.Extensions.Caching.Redis and Microsoft.Extensions.Caching.StackExchangeRedis reveals it.

    Microsoft.Extensions.Caching.Redis is based on StackExchange redis 1.x library, whereas Microsoft.Extensions.Caching.StackExchangeRedis is based on 2.x of the same library.

    Also Microsoft.Extensions.Caching.Redis doesn't seem to target the 3.1 exteionsn libraries (Microsoft.Extensions.Options/Caching.Abstractions) where the other does.

    So for .NET Core 3.x and newer use Microsoft.Extensions.Caching.StackExchangeRedis as the previous one may not be maintained as log as the new one.

    0 讨论(0)
提交回复
热议问题