3

我们设法使用 App Fabric Caching Server 来存储我们的Outputcache,而不更改我们的代码,只使用配置。它运行良好。

有没有办法对 .Net Cache( HttpContext.Current.Cache) 做同样的事情?无需更改我们的代码,只需配置。

谢谢

4

1 回答 1

0

HttpContext Cache没有提供者抽象 ( ProviderBase) 。如@Icarus 所示,有OutputCacheSession 。这将需要更改代码。

这里有几个想法给你...

  1. 使用 AppFabricDataCache而不是HttpContext.Current.Cache. 请参阅Hanselmans 示例
  2. 使用HttpContext Cache ( Application Cache ) 将任何内容转换为Session ( User Cache )。
  3. 请参阅有关构建自定义缓存提供程序的相关 SO 帖子
于 2012-05-11T16:47:41.570 回答