Skip to content

Instantly share code, notes, and snippets.

@roberto-mardeni
Created September 4, 2020 13:49
Show Gist options
  • Save roberto-mardeni/6855008f3ec25db11d9fecc011a0227d to your computer and use it in GitHub Desktop.
Save roberto-mardeni/6855008f3ec25db11d9fecc011a0227d to your computer and use it in GitHub Desktop.
Azure Cache for Redis Configuration Sample
<configuration>
<appSettings>
<add key="RedisConnectionString" value="<name>.redis.cache.windows.net:6380,password=<key>,ssl=True,abortConnect=False" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
<httpRuntime targetFramework="4.7.2" />
<sessionState mode="Custom" customProvider="RedisStateStore">
<providers>
<add name="RedisStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" connectionString="RedisConnectionString" />
</providers>
</sessionState>
<caching>
<outputCache defaultProvider="RedisOutputCache">
<providers>
<add name="RedisOutputCache" type="Microsoft.Web.Redis.RedisOutputCacheProvider" connectionString="RedisConnectionString" />
</providers>
</outputCache>
</caching>
</system.web>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment