When you enable dynamic content compression on a computer that is running Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7 Service Pack 1 (SP1), or Windows Server 2008 R2 SP1, a Vary header is overwritten as "Accept-Encoding."
For example, in an .aspx page, you set the Vary header as "User-Agent" by using the following code:If dynamic content compression is not enabled, the output information resembles the following:
However, if dynamic content compression is enabled, the Vary header is overwritten as "Accept-Encoding," and the output information resembles the following:
For example, in an .aspx page, you set the Vary header as "User-Agent" by using the following code:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Hello");
Response.AppendHeader("Vary", "User-Agent");
}
}
However, if dynamic content compression is enabled, the Vary header is overwritten as "Accept-Encoding," and the output information resembles the following: