If you prefer to not send the ETag HTTP header for files served from IIS 7 or 7.5, it is a bit problematic. To the best of my knowledge, IIS does not provide a straight forward way to remove this header. This post shows a way to do it using Microsoft's URL Rewrite Module 2.0.
I'm not going to go into the what and why of the ETag. Suffice it to say, many web developers and web masters would prefer not to send it.
The ETag can be removed using an outbound URL rewrite rule. You can read more about it at the URL Rewrite Module 2.0 Configuration Reference .
The rewrite rule that can be put in your web.config follows:
<rewrite> <outboundRules> <rule name="Remove ETag" > <match serverVariable="RESPONSE_ETag" pattern=".+" /> <action type="Rewrite" value="" /> </rule> </outboundRules> </rewrite>
This graphic shows the settings for the ETag removal rewrite rule in IIS Manager. In fact, if you look at the headers for the image, you'll see there is no ETag :-)
If you happen to be using Helicon's Ape, then this is very simple as well. You can use a mod_headers rule like:
Header set ETag ""
I hope this helps :-)
Powered by FoxBlog
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2011, Nathan Fox