Internet Explorer 8 and AJAX caching Thursday, April 8, 2010

If you're a web developer and you work with AJAX (I personally prefer the JQuery AJAX library), then you should keep in mind that in Microsoft's infinite wisdom stupidity, they decided that it would be a good idea to cache all AJAX requests. And in typical arrogant Microsoft fashion they (believing they are the only source of truth) haven't provided a way to turn said "feature" off. No meta tag, no javascript DOM function, nothing. The only way that I've found to get around it is to append a throwaway variable to your request (weather it be POST, GET or whatever). Doing this will essentially trick IE into thinking you're making unique requests with each callback.

Example (JQuery):

$.ajax({
url: url,
data: { nbRandom: Math.random() }
});

0 comments:

Post a Comment

Annual Scott Gu event