Export (0) Print
Expand All
3 out of 7 rated this helpful - Rate this topic

Appendix B: Configuring ETag and Max-Age in IIS

Updated: September 1, 2009

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

This appendix describes how to configure the ETag and Max-Age headers.

For all versions of IIS, the ETag value for a returned object is based on the last modified file time. In addition to this generated value, the ETag field uses a configured metabase change number when generating the ETag value. To enable clustered nodes to return the same ETag value, the nodes in the cluster must be configured with a metabase change number of 0. In addition:

  • In IIS 7.0, the metabase change number of 0 is the default setting and cannot be modified.

  • In IIS 6.0, you must hard code the value 0 as the ETag change number by editing the metabase. For more information about modifying the ETag change number value in the metabase, see article 922703 in the Microsoft Knowledge Base (http://go.microsoft.com/fwlink/?LinkId=164805).

  • In IIS 5.0, you must hard code the value 0 as the ETag change number by using Mdutil.exe. For more information about modifying the ETag change number value in the metabase, see article 922733 in the Microsoft Knowledge Base (http://go.microsoft.com/fwlink/?LinkId=164806).

The Max-age header defines the maximum time that a proxy server or client will cache a CRL or OCSP response before using a conditional GET to determine whether the object has changed. The following commands let you set, modify, and delete the Max-Age header setting.

  1. Log on to the IIS 7.0 server as a member of the local Administrators group.

  2. Open an Administrative command prompt.

  3. At the command prompt, type cd \windows\system32\inetsrv, and then press ENTER.

  4. At the command prompt, type

    appcmd set config /section:httpProtocol /+customHeaders.[name='cacheControlHeader',value='max-age=604800']
    
    
  5. Close the command prompt.

  1. Log on to the IIS 7.0 server as a member of the local Administrators group.

  2. Open an Administrative command prompt.

  3. At the command prompt, type cd \windows\system32\inetsrv, and then press ENTER.

  4. At the command prompt, type

    appcmd set config /section:httpProtocol /customHeaders.[name='cacheControlHeader'].value:max-age=86400
    
    
  5. Close the command prompt.

  1. Log on to the IIS 7.0 server as a member of the local Administrators group.

  2. Open an Administrative command prompt.

  3. At the command prompt, type cd \windows\system32\inetsrv, and then press ENTER.

  4. At the command prompt, type

    appcmdlist config /section:httpProtocol 
    
    
  5. Close the command prompt.

noteNote
For more information about creating and modifying response headers from the command line and in the IIS Manager interface, see Configuring HTTP Response Headers in IIS 7.0 (http://go.microsoft.com/fwlink/?LinkId=155666).

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.