如何在应用程序缓存中存储无限量的内容?
我尝试使用HttpContext.Application存储数据[" foo"] = bar。但这段数据会在一段时间后被清除。
答案 0 :(得分:0)
您可以在web config
中添加很好的到期时间,如下所示:
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseExpires"
httpExpires="Tue, 22 Aug 2037 12:00:00 GMT" />
</staticContent>
</system.webServer>
</configuration>
有关详细信息,请参阅this。