5

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

hazzik
  • 12,193
  • 7
  • 42
  • 82
loveNZ
  • 307
  • 2
  • 12

1 Answers1

4

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?

Community
  • 1
  • 1
kwangsa
  • 1,721
  • 12
  • 16
  • Thank you, I found that our backend didn't specific the no cache response header, then after I added it, now app works fine in IE11. once again, thank you. – loveNZ May 07 '15 at 02:25