From 409fae28bd8c15698fe8b49e7691a1d752ea939b Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 28 Feb 2019 14:00:25 -0600 Subject: [PATCH] Update Redis section of dist caching (#11160) --- aspnetcore/performance/caching/distributed.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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/).