Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You cannot prevent Internet Explorer 6 from caching HTTP pages by using META tags


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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

↑ Back to the top


Keywords: KB937479, kbprb, kbtshoot, kbexpertiseinter, kbcaching

↑ Back to the top

Article Info
Article ID : 937479
Revision : 2
Created on : 8/15/2007
Published on : 8/15/2007
Exists online : False
Views : 302