« Mobile Phone Tracking System | Main | Blocking unwanted referrers »

IE7 always keep a cache of the visited pages

Home » Software » Browsers
Home » Internet
Home » Programming » PHP
Home » Programming

The new version Internet Explorer 7 has a problem in caching of the displayed specially if you are using some ajax applications. Even if you have use the meta tags that specifies no cache, the IE7 would ignore them.

<meta name="pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="cache-control" content="no-cache">

The above code does not work on IE7. You could force the browser to remove the cache by manually deleting it or by using the following code below in PHP:

// choose a date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// set the last modified date to today
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// if the browser supports HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// if the browser supports HTTP/1.0
header("Pragma: no-cache");

Another way is to add the meta tag code below in between your end body tag and your end html tags. It does not conform to the w3c standards, but it works. :D

</body>
<head>
<meta http-equiv="PRAGMA" content="NO-CACHE" />
</head>
</html>

TrackBack

TrackBack URL for this entry:
http://www.tildemark.com/cgi-bin/mt/mt-tb.cgi/74

About

This page contains a single entry from the blog posted on March 29, 2007 12:50 PM .

The previous post in this blog was Mobile Phone Tracking System .

The next post in this blog is Blocking unwanted referrers .

Many more can be found on the main index page or by looking through the archives .

Creative Commons License
This weblog is licensed under a Creative Commons License .
Powered by
Movable Type 3.33