• missing xbfish.com image

Clearing Cache in IE for AJAX

missing xbfish.com image
Posted on

This is very disturbing. Our good friend FireFox has no problem. But for Internet Explorer, they will always cache the AJAX content and this results the AJAX content that is being fetched is obsolete and not the latest.

To resolve this, assuming u are using PHP, add the following code on the start of the AJAX page:

1
2
3
4
5
<?php
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

Source: http://greenash.net.au/posts/thoughts/an-ie-ajax-gotcha-page-caching

One comment

  • January 29, 2009 - 10:33 pm | Permalink

    Internet explorer is a problematic child. Always give problems. Waste my time debugging.
    BTW, you want order some pork?

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

    Spam protection by WP Captcha-Free