How do I remove eTag headers from IIS7?

后端 未结 12 1972
旧巷少年郎
旧巷少年郎 2020-12-04 07:28

Per Yahoo\'s best practices for high performance web sites, I\'d like to remove Etags from my headers (I\'m manually managing all my caching and have no need for Etags... an

相关标签:
12条回答
  • 2020-12-04 07:58

    I think this will work .. I know remove and blank doesn't work.

        <configuration>
         <system.webServer>
           <httpProtocol>
              <customHeaders>
                <add name="ETag" value=" " /> 
              </customHeaders>
            </httpProtocol>
           </configuration>
         </system.webServer>
    
    0 讨论(0)
  • 2020-12-04 08:01

    I Used the removeetag.dll found on http://www.caspianit.co.uk/iis7-etag-problem/ and it worked perfectly.

    hope it will work well for you too

    0 讨论(0)
  • 2020-12-04 08:02

    Check out this blog post on how to completely remove the Etag http header in iis6,iis7 and iis7.5

    http://lightspeednow.com/blog/2010/05/21/iis-tutorial-how-to-completely-remove-etags-entity-tags-from-iis6-iis7-and-iis7-5/

    0 讨论(0)
  • 2020-12-04 08:04

    I realize this is an old question, but I came across it while searching for a solution. I think I found a reasonable answer which I posted for this question.

    0 讨论(0)
  • 2020-12-04 08:06

    We had this problem, and even setting a blank custom ETag header in IIS 7 was not working for all files (for example image files). We ended up creating an HttpModule that explicitly removes the ETag header.

    0 讨论(0)
  • 2020-12-04 08:07

    In IIS 7 you shouldn't have to worry about etags anymore as the IIS configuration number is always set to 0.

    There is still a problem if you have IIS6 & IIS7 webservers in the same farm. In this case you would have to manually set the IIS6 config number to 0 as described in this article.

    Etags are actually very useful as you don't need to change the filename like stack overflow does (i.e. default.css?1234). If you change the default.css file it will change the etag and therefore subsequent requests will get the file from the server and not the cache.

    0 讨论(0)
提交回复
热议问题