我如何在我的WEB APP (ASP.NET MVC)中删除响应头中所有请求的Vary:* ?
谢谢。
谢谢。
protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
{
HttpContext.Current.Response.Headers.Remove("Vary");
}
或者在你的 web.config 中添加如下内容:
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="Vary" />
</customHeaders>
</httpProtocol>
</system.webServer>
Vary:*
,这样Vary:Accept-Encoding
就可以了? - Harry