IIS 7.5 remove etag headers from response

*爱你&永不变心* 提交于 2019-11-28 03:50:45

You can use the IIS Rewrite Module 2.0 to remove the ETag. The following rewrite rule should do it:

<rewrite>
   <outboundRules>
      <rule name="Remove ETag">
         <match serverVariable="RESPONSE_ETag" pattern=".+" />
         <action type="Rewrite" value="" />
      </rule>
   </outboundRules>
</rewrite>

You can see an example image of the rule configuration in IIS Manager on my blog.

For those of you that come across this answer in search of the same solution but for IIS 8 or IIS 8.5, here is what I've come up with. Thank you to this post on blogs.iis.net for pointing me in the right direction.

Reference: clientCache on the IIS documentation website.

In your web.config, add:

<configuration>
    ...
    <system.webServer>
    ...
        <staticContent>
            <clientCache setEtag="false"/>
        </staticContent>
    ...
    </system.webServer>
    ...
</configuration>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!