Administering an ISP Installation

Previous Topic Next Topic

With a Custom HTTP Header

This sample code shows the same request sent with an HTTP header that causes content to expire in 30 minutes:

CLIENT REQUEST
GET /samplecorp/images/undercon.gif HTTP/1.1
Accept: */*
Referer: http://bicent/samplecorp/
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000)
Host: bicent
Connection: Keep-Alive
Cookie: ASPSESSIONIDGQQGQGBE=PGIFFNMBCAOPEHGGKOGJODID

SERVER RESPONSE
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Cache-Control: max-age= 1800
Expires: Tue, 14 Oct 1999 18:24:21 GMT
Date: Tue, 14 Oct 1999 17:54:21 GMT
Content-Type: image/gif
Accept-Ranges: bytes
Last-Modified: Tue, 14 Oct 1999 15:53:27 GMT
ETag: "0d1974fb9d8bc1:ecb"
Content-Length: 293

Notice the two lines enabling content expiration. While Cache-Control affects the proxy cache, Expires affects the browser cache.

You can set custom HTTP headers and content expiration globally or apply them to a specific directory.

To set HTTP headers for content expiration

  1. In the IIS snap-in under Internet Information Services, right-click the Web site or virtual directory on which you want to set custom HTTP headers.
  2. Click Properties.
  3. Select Enable Content Expiration.
  4. On the HTTP Headers property sheet, add a custom header in the Custom HTTP Headers box.

    For help in creating a custom header, click the Help button on the property sheet.

  5. Click OK.

For more information, see the IIS 5.0 online product documentation.


© 1997-1999 Microsoft Corporation. All rights reserved.