I want set the expiration for the Web site content and in IIS 5 and IIS 6 it is done by going to the Internet Information Services and right click on the website and select properties, and HTTP Headers. But I tried to record that procedure using TC. However it seems that TC has trouble selecting the specific site that I want. As well as can't find the property button.
Is there an easier way for TC to change that exp date? Such as using registry keys? If that is possible does anyone know which registry key I need to change? Or if there is another easier way?
You can manipulate this the expiration date of a Web server via the IIS Admin object. Here is an example of how to set the 'Expire after 77 days' value for the expiration date of the local default web site.
[VBScript]</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Sub TestIISExpire
newExpire = "D, 0x658380"
Set obj = GetObject("IIS://localhost/W3SVC/1/ROOT"
obj.HttpExpires = newExpire
End Sub</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Please see the following quote from the corresponding MSDN Library article:
The HttpExpires property specifies the expiration of HTML document content by returning the value to the browser in the HTML file header. The browser compares the given value with the current date to determine whether to display a cached page or to request an updated page from the server. This property can be made relative, or dynamic, by using the format D, #SecondsUntilExpiration, with 0xFFFFFFFF indicating no expiration date. It can also be absolute, with the format S, ValidGMTstring.
<font size="2" face="Verdana, Arial, Helvetica">The 'localhost' item in the 'IIS://localhost/W3SVC/1/ROOT' metabase path is the server name, the 'W3SVC' is the service name (you should not change it), '1' - is the Web site number. 'ROOT' denotes the server root virtual directory. You can add the name of the specific virtual directory, if you would like to: 'IIS://localhost/W3SVC/1/ROOT/LoadTesting'.