Microsoft KB Archive/937479

From BetaArchive Wiki

Article ID: 937479

Article Last Modified on 8/15/2007



APPLIES TO

  • Microsoft Internet Explorer 6.0



SYMPTOMS

You create an HTML page that prevents page caching by using the following META tags.

<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/> 
<meta http-equiv="Expires" content="-1"/>

However, when you use Microsoft Internet Explorer 6 to browse the page from a Web server in HTTP, the page is still available in the cache.

CAUSE

This issue occurs when the connection to the Web server is not a Secure Sockets Layer (SSL) connection. Over ordinary connections, MSHTML will only read the Expires tag, and Internet Explorer will set the Expiration header based on the Expires tag content value.

RESOLUTION

To resolve this issue, set the Expires header and the No-cache header on the Web server that is hosting the HTML files that you do not want to be cached. On the Web server, you can set the Expires header and the No-cache header on the following items:

  • Web site
  • Directory
  • File

Therefore, you can control how files are cached on the client computer for these items.

For more information about content expiration in Internet Information Services (IIS), see the "Enabling Content Expiration" topic in the "Web Site Management" section of the IIS online documentation. The following is a link to IIS Help if you have IIS installed on the computer:

For more information about how to configure IIS 5.0 for content expiration, click the following article number to view the article in the Microsoft Knowledge Base:

313561 How to set HTTP headers for content expiration in Internet Information Services (IIS) 5.0


For more information about how to set the Expires header and the No-cache header for other Web server software, see the Web server's documentation.

WORKAROUND

To work around this issue, use one of the following methods.

Method 1: Use SSL

Serve the pages through an SSL connection. For more information about how to use SSL in IIS, click the following article number to view the article in the Microsoft Knowledge Base:

299875 How to implement SSL in IIS


Method 2: Use an ASP file

Use an ASP file to set the headers in the response from the Web server. The following is an example of a response.

<%Response.CacheControl = "no-cache" %>
<% Response.AddHeader"Pragma", "no-cache" %> 
<% Response.Expires = -1 %>

For more information about how to configure ASP pages, click the following article numbers to view the articles in the Microsoft Knowledge Base:

811431 How to cache in ASP.NET by using Visual Basic .NET


323290 How to cache in ASP.NET by using Visual C# .NET



Additional query words: IE6

Keywords: kbcaching kbexpertiseinter kbtshoot kbprb KB937479