IIS 7.5 removes etag headers from response

I know that this question has been asked many times, but most of them were in 2009-2010.

I am sure that some time ago the project I was working on deleted them, however I cannot find a way to delete them at the moment.

So have there been any successes in this area? It seems crazy that microsoft made IIS unable to easily configure these headers.

Currently tried:

  • Adding a blank etag header to web.config
  • Adding etag with quotes inside web.config
  • Adding a blank etag header directly through IIS
  • Adding a custom module that removes etag on BeginResponse
  • Same as above, but for EndResponse
  • As above, but instead of deleting the stage, make it empty

I heard that there is an ISAPI filter that you can remove, but I cannot find it anywhere, and I have no experience writing one from scratch, but it may be the only way to do this.

Just so there is a reason why I want to remove Etags for everything. I let clients cache everything (expires and is updated last), therefore, as soon as my static files are received from the server, it never needs to request the server again until it expires. As if you are using Etags, you still need to make a server request for each file to see if the tag matches. Therefore, using the client’s cache, you only make requests for the content you need.

I also have a version control system, so when the change occurs, does the static content then refer to my.js? 12345 , not my.js? 12344 . In any case, I believe that removing Etags will significantly improve one of the bottlenecks in my current project.

+27
caching iis etag
Oct 30 '11 at 19:57
source share
2 answers

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

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

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

+52
Nov 11 '11 at 4:01
source share

For those of you who come across this answer looking for the same solution, but for IIS 8 or IIS 8.5 , this is what I came up with. Thanks to this blogs.iis.net post for pointing me in the right direction.

Link: clientCache on the IIS documentation website.

In your web.config add:

 <configuration> ... <system.webServer> ... <staticContent> <clientCache setEtag="false"/> </staticContent> ... </system.webServer> ... </configuration> 
+12
Nov 06 '14 at 21:11
source share



All Articles