diff --git a/aspnetcore/performance/caching/distributed.md b/aspnetcore/performance/caching/distributed.md index c54302b89c..1ed669cdef 100644 --- a/aspnetcore/performance/caching/distributed.md +++ b/aspnetcore/performance/caching/distributed.md @@ -134,8 +134,23 @@ The sample app implements instance (): +::: moniker range=">= aspnetcore-2.2" +[Redis](https://redis.io/) is an open source in-memory data store, which is often used as a distributed cache. You can use Redis locally, and you can configure an [Azure Redis Cache](https://azure.microsoft.com/services/cache/) for an Azure-hosted ASP.NET Core app. An app configures the cache implementation using a `RedisCache` instance (`AddStackExchangeRedisCache`): + +```csharp +services.AddStackExchangeRedisCache(options => +{ + options.Configuration = "localhost"; + options.InstanceName = "SampleInstance"; +}); +``` + +::: moniker-end + +::: moniker range="< aspnetcore-2.2" + +[Redis](https://redis.io/) is an open source in-memory data store, which is often used as a distributed cache. You can use Redis locally, and you can configure an [Azure Redis Cache](https://azure.microsoft.com/services/cache/) for an Azure-hosted ASP.NET Core app. An app configures the cache implementation using a instance (): ```csharp services.AddDistributedRedisCache(options => { @@ -144,6 +159,8 @@ services.AddDistributedRedisCache(options => }); ``` +::: moniker-end + To install Redis on your local machine: * Install the [Chocolatey Redis package](https://chocolatey.org/packages/redis-64/).