IE Ajax Caching Issue

11 February 2009| 4 Comments| Print

Internet explorer seems to feel the need to cache everything, which can turn a simple ajax request into an IE nightmare.

Add this to the top of your php script, and all your IE Ajax caching problems will be solved!


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");

Share:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • StumbleUpon
  • Google Bookmarks
  • DZone
  • Reddit
  • Netvibes

4 Comments

  • jonas

    Beautiful post! I have been straining my hair for about 2 hours and your tip solved everything :)

  • Ashley

    Jonas, pleased to hear I solved your problem! :)

  • anon

    dude, you’re great! :-)

  • charles

    great solution. will add this to the top of my php script.

Leave a comment...

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled site. To get your own globally-recognized-avatar, register at Gravatar.

Your Ad Here