Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NET MVC核心-OutputCache启动操作_Asp.net_Asp.net Mvc_Asp.net Core_Asp.net Mvc 4 - Fatal编程技术网

ASP.NET MVC核心-OutputCache启动操作

ASP.NET MVC核心-OutputCache启动操作,asp.net,asp.net-mvc,asp.net-core,asp.net-mvc-4,Asp.net,Asp.net Mvc,Asp.net Core,Asp.net Mvc 4,当尝试测试这个时 [OutputCache(Duration=86400, VaryByParam = "id"] public ActionResult Index(string id) { } 结果是索引操作仍在执行??在这种情况下,我希望整个html页面在缓存内存中存储1天?试试这个 要在启动类中配置方法,请添加: app.UseResponseCaching(); 并按如下方式更改属性: [ResponseCache(Duration=86400, Var

当尝试测试这个时

[OutputCache(Duration=86400, VaryByParam = "id"]
public ActionResult Index(string id) {

}
结果是索引操作仍在执行??在这种情况下,我希望整个html页面在缓存内存中存储1天?

试试这个

要在
启动
类中配置
方法,请添加:

            app.UseResponseCaching();

并按如下方式更改属性:

[ResponseCache(Duration=86400, VaryByParam = "id"]
public ActionResult Index(string id) {

}
试试这个

要在
启动
类中配置
方法,请添加:

            app.UseResponseCaching();

并按如下方式更改属性:

[ResponseCache(Duration=86400, VaryByParam = "id"]
public ActionResult Index(string id) {

}