Am trying to call some REST APIs from my AngularJS code. When looking at the page load time (say through Developer Tools -> Network in a browser like Firefox), the icons in the page load quickly. Then there is about 100 to 200ms gap, only after which the REST API is even called. I worked a simple example in Plunkr here : http://plnkr.co/edit/aTk8D9RXdmqBXoCwpVuG?p=preview
return $http({
method: 'GET',
url: 'http://rest-service.guides.spring.io/greeting'
});
}
return restAPIs;
})
.controller('AppCtrl', function($scope,restFactoryService){
restFactoryService.getInstanceDetails().success(function (data){
$scope.datas=data;
});
});
I have used ng-repeat in my original code. I initially thought that the slowness was due to that. But, as you can see above, even with a simple REST API call, the delay happens. Also, see the screenshot below showing the page loading. You can see that the page loads in 80ms. Then there is a gap until 240ms, only after which the REST API is called. What is happening between 80ms and 240ms time frame? Why can't the REST API be called at 80ms itself?

Can someone please help?
debuggerbefore the request to see the time its reached ?