【发布时间】:2021-12-26 16:18:15
【问题描述】:
我有一个基于 ASP.NET Webforms 的网站,我正在将其转换为 ASP.NET Core 3.1 MVC。
我曾使用 Redis 作为我的 OutputCache 提供程序来缓存网站页面。我的web.config 在之前的网站上也有同样的设置。
<caching xdt:Transform="Replace">
<outputCache defaultProvider="rdstest">
<providers>
<add name="rdstest" type="Microsoft.Web.Redis.RedisOutputCacheProvider" host="rdstest............."
accessKey="xxxxxx=" databaseId ="1" port="xxxx" ssl="true" applicationName="xxxx" />
</providers>
</outputCache>
</caching>
我在网上查看了将 redis 用于相同目的的最佳方法,但找不到任何简单的实现。
大部分文章都使用 redis 作为数据缓存,很少有人展示如何简单地缓存输出页面。
我们将不胜感激。
谢谢。
【问题讨论】:
标签: asp.net-core-mvc stackexchange.redis outputcache