[英]How can I check if a request is made to the cache?
I use a MVC application that use "outputcache" attribute:我使用使用“输出缓存”属性的 MVC 应用程序:
namespace CachingInMVC.Controllers
{
public class HomeController : Controller
{
[OutputCache(Duration = 10, VaryByParam ="none", Location =
OutputCacheLocation.Server)]
public ActionResult Index()
{
return Content(DateTime.Now.ToString("T"));
}
public ActionResult About()
{
ViewBag.Message = "Your application description page.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
}
How can i know/check if "index" works on cache or on server?我如何知道/检查“索引”是否适用于缓存或服务器?
You can check that in two ways:您可以通过两种方式进行检查:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.