Continue with ASP. NET MVC 3 site optimization work, using Google Page detection discovery Tips You should specify vary:accept-encoding header,the following publicly cacheable, compressible Resources should have a "vary:accept-encoding" header.
I believe many people have encountered this problem, what does it mean? The information found online is:
originally on the CSS and JS file opened gzip, will output two files: gzip compressed, without gzip compression, so not only to speed up the page loading speed, but more slowly; Vary:accept-encoding header Specifies the portion of the file to which the output has been compressed. In this way, gzip compression is really playing a role.
The workaround is to add the following snippet below the configuration node:
<configuration> <system.webServer> <customheaders& Gt <remove name= "Vary" ></remove> <add name= "Vary" value= "accept-encoding" ></add > </customheaders> </ Httpprotocol> </system.webserver></CONFIGURATION>
Rerun the site and find that this issue has been resolved, such as:
This improves the performance of our ASP. NET MVC 3 site, and next we look at the use of the cache in ASP. 3.
ASP. NET MVC 3 website optimization Summary (iii) Specify Vary:accept-encoding header