Issue:
I have a Mootools Request object which sends a GET request to a PHP script. The script returns an array of IDs. In every browser except IE each time a new instantiation of the Request object is made it hits the PHP backend script – no problem. BUT with IE it only every hits the PHP script once per browser session. If I clear the cache it flows through to the backend again OK, but after a browser restart or cache refresh.
Question:
- Is IE blocking my requests with caching somehow?
- If so I there something I can change to prevent IE from blocking the Requests?
Note:
- The issue is present on IE9 and on
IE9 in compatibility mode. I have not
tested on older IE versions. - Using
page-wide no-cache is not an option. - I used a error_log() statement in my script to check whether is was getting reached or not.
Here’s my code:
requestIDs : function() {
new Request({
url : "/identity/idGenerator.php?generate_ids",
method : "get",
onSuccess : function(response) {
this.container.set('html', '');
var idList = response.split(",");
console.log(idList.join(","));
}.bind(this)
}).send();
}
});
You need to prevent IE from caching the request, here is one solution.
And the right solution which is built in mootools is initializing the Request with the config param
noCache:true