A simple ajax request using Mootools:
new Ajax('Ajax.aspx', {
method: 'get',
update: $('updateElement')
}).request();
All worked fine in Firefox and Opera. But in IE didn’t. The request simply wasn’t being made. Why?
Well, it seems that IE makes cache of the request. To avoid this feature, you only need to change the code above into the following:
var ajax = new Ajax('Ajax.aspx', {
method: 'get',
update: $('updateElement')
});
if (window.ie) {
ajax.setHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
}
ajax.request();
“The If-Modified-Since request-header field is used with the GET method to make it conditional: if the requested resource has not been modified since the time specified in this field, a copy of the resource will not be returned from the server; instead, a 304 (not modified) response will be returned without any Entity-Body.”
source: http://www.freesoft.org/CIE/RFC/1945/58.htm
Because the content has been modified since the date passed, the request will be made to the server in order to get a fresh copy of the page.
Other solution could be adding a time stamp to the request, example:add a query string attribute with the current date.