When you request a static file from a web site powered by IIS, IIS will return HTTP headers like the following:
HTTP/1.1 200 OK
Content-Length: 4835
Content-Type: text/html; charset=utf-8
Content-Location: http://servername/index.html
Last-Modified: Tue, 26 Sep 2006 03:35:29 GMT
Accept-Ranges: bytes
ETag: "704349d01ce1c61:d05"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Tue, 26 Sep 2006 06:29:11 GMT
The ETag header is meant to be a unique value that describes the file being retrieved. Note the "d05" in the ETag value. If you restart IIS and request the same file, the ETag won't be "d05", but will be another value. (It appears to be the IIS metabase "change number" value).
This change in value causes problems if you have a cluster of web servers serving up the same file content, but with different ETags. Because the same file essentially has different ETag values at different points in time, the file content may be retransmitted unnecessarily.
To fix this problem, you can explicitly set the ETag sub-value by setting the MD_ETAG_CHANGENUMBER property in the IIS metabase. It doesn't seem possible to do this by using the adsutil.vbs script, but you can do it by manually editing the metabase.xml file, or by following these instructions:
- Download and install the IIS Resource Kit Tools to get the Metabase Explorer.
- Run the Metabase Explorer, navigate to COMPUTERNAME -> LM -> W3SVC, right-click it, and choose New -> DWORD Record. Enter the following and hit OK:
- Double-click the new "2039" property that was added to the list on the right half of the window. Enter the numeric value that you'd like to use in the ETag instead of a constantly-changing value.
- Switch to the General tab and make it look like the following and hit OK:
Now IIS should use the ETag sub-value that you specified instead of of a constantly-changing value. Note that if you somehow make a server configuration change where you want the ETag value to change, you can go back into Metabase Explorer and change the value. Or, delete the "2039" property to go back to the old behavior.