How do I remove eTag headers from IIS7?

后端 未结 12 1993
旧巷少年郎
旧巷少年郎 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 08:23

    UPDATE: added URL Rewrite Module requirement thanks to user @ChrisBarr

    In iis 6 it's easy, you can add a custom header for 'ETag' = ""

    In IIS 7, after reading this thread and figuring that it was impossible without using a custom http module, I found that you can simply install Microsoft's URL Rewrite module and add an outbound rewrite rule as follows:

    
      
        
        
      
    
    

    This actually works, and you don't need a custom http module (dll). Unlocking the system.webServer configuration section and setting customHeaders, etc., does not work - at least in all the cases I tried. A simple outbound rewrite rule does.

提交回复
热议问题