可以通过在Global.asax文件中使用事件处理程序来覆盖或删除Cache-Control和Pragma头。以下是一个示例:
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
HttpContext.Current.Response.Cache.SetMaxAge(TimeSpan.Zero);
HttpContext.Current.Response.Cache.AppendCacheExtension("no-store, must-revalidate");
HttpContext.Current.Response.AppendHeader("Pragma", "no-cache");
}