我正在尝试像在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。
我该如何解决?