Reputation: 131
Despite performance tests throughout my server consistently returning results of ~50ms, any call to controller methods in my c# code using angularjs (1.4) or jquery (1.9.1) produce inconsistent ttfb times. Sometimes they will successfully return the data in less than 100ms whereas other times the ttfb will reach upwards of 1.5s. I have also individually tested calling the controller methods through my browser (cache was disabled) and data returned was lightening quick (less than ~50ms).
Calling my controller:
$http.get(baseUrl + "Home/AnnouncementsPartial", { params: { startIndex:
$scope.startIndex, numberMessages: $scope.numberMessages, resetSearch: reset
} }).success(function (data) {
Waterfall demonstration:
I am running on localhost so knowing that my controller methods return data in ~50ms, I would expect the ttfb times to be under 100ms at least. Any help much appreciated
Upvotes: 1
Views: 2351
Reputation: 131
Answer to this one was what DiskJunky mentioned in the comments section, there is a maximum number of concurrent requests that a web browser can handle in one connection until it starts to generate new requests sequentially. For this scenario, I structured my code slightly differently so my higher priority requests were executed first and therefore ran concurrently with each other.
Upvotes: 1