【问题标题】:Configure OutputCache with remote Redis in ASP.NET MVC 5在 ASP.NET MVC 5 中使用远程 Redis 配置 OutputCache
【发布时间】:2017-06-24 11:31:30
【问题描述】:

我正在尝试为我的 OutputCache 连接到 Redis,我已在 web.config 中进行了配置(对于 localhost,一切正常)

<system.web>
    <caching>
      <outputCache defaultProvider="localRedisOutputCache">
        <providers>
          <add name="localRedisOutputCache" type="Microsoft.Web.Redis.RedisOutputCacheProvider" host="127.0.0.1" accessKey="" ssl="false" />          
        </providers>

      </outputCache>
    </caching>
</system.web>

但是当我更改为我的 Azure Redis 时,它无法正常工作...

<system.web>
    <caching>
      <outputCache defaultProvider="remoteRedisOutputCache">
        <providers>
          <add name="remoteRedisOutputCache" type="Microsoft.Web.Redis.RedisOutputCacheProvider" host="{{myName}}.redis.cache.windows.net" accessKey="{{MyAccessKey}}" ssl="true" />

      </outputCache>
    </caching>
</system.web>

我已阅读this article 并测试了所有可能性,但没有结果。我没有异常,并且解决方案可以正确编译。

我错过了什么?

谢谢!

【问题讨论】:

    标签: asp.net-mvc azure caching redis outputcache


    【解决方案1】:

    尝试在您的 web.config 中指定 databaseId 字段,检查以下链接并告诉我https://www.captechconsulting.com/blogs/azure-redis-cache

    【讨论】:

      猜你喜欢
      • 2017-04-25
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 2018-02-01
      • 2015-12-09
      • 1970-01-01
      • 1970-01-01
      • 2011-05-14
      相关资源
      最近更新 更多