javascript - Is data cached on server or client or not at all in AngularJS when an error occurs in a promise? -
keep in mind, i'm running old version of angularjs (1.0?), things may have changed, have code looks like:
promise = $http.get(urlformattedstring).success(function (data) { data.foreach(function (result) { //do result , $scope}); promises.push(promise); $q.all(promises).then(function (data) { //do when works! }; when no errors thrown, "works", question happens when 1 of promises throws error (say 1 out of 20)? let's make more interesting (and closer application) , assume each promise requesting data database (mongodb in case).
if have re-run everything, mean data needs fetched again? relying on database cache data repeated requests run faster? or maybe server (nodejs in case) caches data? along these lines, when data sent client server? upon success of promises or data returned client each promise separately? , if so, angular caching?
just laying out here makes me realize pretty complex , lots of scenarios consider. appreciate or pointers reading/documentation on subject. thanks!
suggest familiarize network tab of browser dev tools.
you can see every request made resources html images scripts ajax requests. give far better feel how app works in general
as errors ... unless implement error handling app fail request no indication given user went wrong.
as caching ... ajax requests won't cached client side , unless have implemented caching mechaanisms on server won't cached there either
Comments
Post a Comment