Pain Posted January 9, 2013 Share Posted January 9, 2013 Hi. I have a very common problem, IE caches stuff, so in order to see new things come up i must reload all page. function mountOne() { var myurl = 'mount_shotgun.php'; myRand = parseInt(Math.random()*99999999); // cache buster var xmlhttp2; if (window.XMLHttpRequest) { xmlhttp2 = new XMLHttpRequest; } xmlhttp2.onreadystatechange = function() { if (xmlhttp2.readyState == 4 && xmlhttp2.status == 200) { document.getElementById("retrieve").innerHTML=xmlhttp2.responseText; } } $('#inventory_item1').css("background-image", "url('images/shotgun.png')"); xmlhttp2.open("GET", myurl + "?rand=" + myRand, true); xmlhttp2.send(); } My attempt to bust it using a random token was unsuccessfull var myurl = 'mount_shotgun.php'; myRand = parseInt(Math.random()*99999999); // cache buster I would gladly appreciate any kind of help. Thank you. Quote Link to comment Share on other sites More sharing options...
Christian F. Posted January 10, 2013 Share Posted January 10, 2013 You can just set the HTTP cache headers, in order to stop the browser (or anything else) from caching the pages. Quote Link to comment Share on other sites More sharing options...
Pain Posted January 10, 2013 Author Share Posted January 10, 2013 (edited) i've tried header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); but nothing has changed.. Edited January 10, 2013 by Pain Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.