When we use $http to get the data from the server in AngularJS a small issue arises only in Internet Explorer. The major problem of this issue is that if we want to refresh the data by sending the same call again to the server, Internet Explorer fetches the data from the cache and do not show the updated result.
To solve the problem you only have to implement a small code in your AngularJs Module Configuration part
var myApp = angular.module('myApp', ['ngRoute']);
myApp.config(['$routeProvider', '$httpProvider', function($routeProvider, $httpProvider) {
$httpProvider.defaults.cache = false;
if (!$httpProvider.defaults.headers.get) {
$httpProvider.defaults.headers.get = {};
}
// disable IE ajax request caching
$httpProvider.defaults.headers.get['If-Modified-Since'] = '0';
//.....here proceed with your routes
}]);
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Ashish Sharma
Ashish is a bright Groovy and Grails developer and have worked on development of various SaaS applications using Grails technologies. Ashish likes PC games and works out at Gym in his free time.