I am working on an angular v1.3 app and I am using angular-poller in one my controllers to automatically send request to get new data from my backend every 2 seconds.
It works fine in Chrome, but does not work in IE11. But strangely enough, I am using the Fiddler to see if the requests are sent out when I using IE11, I can see that on IE 11, if the development tools window is opened, then the requests are sent through, and my app works properly, but if I don't open the development console, requests are not even being made, at least it is what fiddler shows me.
poller.get(myResourceService, { action: 'get',
argumentsArray: [{
id: $stateParams.id
}],
delay: '2000',
smart:true })
.promise.then(null, null, function(result) {
$scope.details= result;
});
The above is the code I have in my controller. It is really an annoying issue, and I have spent hours on it. So, any help would be very appreciated.
Cheers
What i found with IE is that they cache AJAX call & when you using Fiddler/Development tools it will behave differently ie not caching AJAX Call. In order to resolve this issue, i usually add Cache-Control header in the response header and fill it with "no-cache".
Check this link for more detail How to control web page caching, across all browsers?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With