protected override void OnActionExecuted(ActionExecutedContext filterContext)
{
base.OnActionExecuted(filterContext);
AddRequiredInfoToViewBag();
if (Request.IsAjaxRequest())
{
Response.CacheControl = "no-cache";
Response.Cache.SetETag((Guid.NewGuid()).ToString());
}
}
当我从部分视图调用操作时,上面的代码会崩溃。有人知道如何检查 ETag 是否已设置在缓存中吗?