我正在尝试像在 ASP.NET MVC 5 中那样缓存输出控制器。
我在 ASP.NET MVC 5 控制器中做到了这一点:
[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 中添加了一个断点,但是每次都会触发断点。
我该如何解决?