【发布时间】:2013-07-02 18:45:26
【问题描述】:
是否可以在 web.config 中为 MVC4 .net 页面设置缓存的持续时间?我有:
[OutputCache(Duration = Convert.ToInt32(ConfigurationManager.AppSettings["cache.eventPage"]), VaryByParam = "Id")]
public ActionResult....
不会编译,因为
属性参数必须是属性参数类型的常量表达式、typeof表达式或数组创建表达式
我们的流量非常高,希望能够在不推出新版本的情况下快速更改此值。这可能吗?
【问题讨论】:
标签: asp.net asp.net-mvc-4 caching output-caching