[英]Caching in ASP.NET 5 in Controller
我试图像在ASP.NET MVC 5中那样缓存输出控制器。
我在ASP.NET MVC 5 Controller中做到了这一点:
[OutputCache(Duration = 60, VaryByParam = "*", Location = OutputCacheLocation.ServerAndClient)]
现在,我在ASP.NET 5 MVC 6中尝试这样做:
控制器属性:
[ResponseCache(CacheProfileName = "TestCache")]
在我的Startup.cs中 :
//Caching
services.Configure<MvcOptions>(options => options.CacheProfiles.Add("TestCache", new CacheProfile()
{
Duration = 3600,
Location = ResponseCacheLocation.Any,
VaryByHeader = "*"
}));
我在TestController中添加了一个断点,但每次都会触发breakboint。
我该如何解决?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.