Disable caching for $http.get method

An important consideration when using  GET for AJAX requests is that some browsers – IE in particular – will cache the results of a GET request. So if you, for example, using the same GET request you will always get back the same results, even if the data you are querying is updated at server-side. One way to avoid this problem is to make the URL unique for each request by appending a time stamp. As shown below :


$http ({
         method :’GET’
         url: ‘…’,
        params : { ‘time’ : new Date().getTime() }

Another workaround to avoid the caching of GET method results is to set cache to false

this.getResults = function() {
return $http({
 method: ‘GET’,
 cache: false,
 url: urlBase+’/controller/getResults’

2 thoughts on “Disable caching for $http.get method

  1. Thanks for this info as I suffer this problem mostly and was wrapping my head around to find out the reason for this.
    Thanks for this article as its of great help


Comments are closed.