Thursday, July 16, 2020

Azure Redis cache provider asp.net


Redis Cache provider

The Redis Output Cache Provider is an out-of-process storage mechanism for output cache data. This data is specifically for full HTTP responses (page output caching). The provider plugs into the new output cache provider extensibility point that was introduced in ASP.NET 4. For ASP.NET Core applications, read Response caching in ASP.NET Core.

To use the Redis Output Cache Provider, first configure your cache, and then configure your ASP.NET application using the Redis Output Cache Provider NuGet package. This topic provides guidance on configuring your application to use the Redis Output Cache Provider. For more information about creating and configuring an Azure Cache for Redis instance, see Create a cache.

Store ASP.NET page output in the cache

To configure a client application in Visual Studio using the Azure Cache for Redis Session State NuGet package, click NuGet Package ManagerPackage Manager Console from the Tools menu.

Run the following command from the Package Manager Console window.

Install-Package Microsoft.Web.RedisOutputCacheProvider

The Redis Output Cache Provider NuGet package has a dependency on the StackExchange.Redis.StrongName package. If the StackExchange.Redis.StrongName package is not present in your project, it is installed. For more information about the Redis Output Cache Provider NuGet package, see the RedisOutputCacheProvider NuGet page.

<caching>

  <outputCache defaultProvider="MyRedisOutputCache">

    <providers>

      <add name="MyRedisOutputCache" type="Microsoft.Web.Redis.RedisOutputCacheProvider"

           host=""

           accessKey=""

           ssl="true" />

    </providers>

  </outputCache>

</caching>

https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-aspnet-output-cache-provider

No comments :