我有用 OutputCache 属性装饰的控制器操作:
[OutputCache(Duration = 60 * 60 * 12, VaryByParam = "*")]
public ActionResult GetProducts(int id, string template, string version)
我想在调试模式下禁用它,所以我使用了 web.config 转换,所以在调试模式下我得到了这些额外的行:
<caching>
<outputCache enableOutputCache="false" enableFragmentCache="false" />
</caching>
但是缓存仍然有效 - 动作结果被缓存,在视图中更改代码在渲染时无效。
有任何想法吗?
IT人