angularjs - Does Angular $http cache failed attempts? -


i wasn't sure of , didn't see documentation on it. if call so...

... return $http.get(baseurl + '/lists/' + listobj.id, {cache: true})     .then(function(resp){           ...           return null;     }, function fail(err){           return $q.reject(err);     }); 

angular cache http response , use value next time call same http request. however, let connection fails or list object id has since been created url works. will have cached failed attempt?

if have manually dig $http.defaults.cache , remove it?

you wouldn't need to. when cache enabled angular keeps promise object respect url in cache , subsequent requests receive same promise call server not made again. in case of unsuccessful calls cache will removed ajax call comes sever. if make more calls between time same failure calls since have same promise.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -