Reputation: 3793
Does number of Ajax request makes a difference on the performance of the server.
I wish to know, what would be better for me for 5 ajax request at a time for 5 individual items on my webpage or making only one request which will fetch the data for each of them.
Does it anyhow affect how my server will respond to traffic ?
Thanks
Upvotes: 2
Views: 70
Reputation: 1128
Instead making 5 requests you have to use a single request to fetch all the data at a single time. & 5 different requests surely affect your server.
Upvotes: 1
Reputation: 255005
AJAX request is an ordinary request. There is no anything specific or magical in it in comparison to the request performed after you pressed enter in your browser's address bar.
As you understand - each server has its own limit of simultaneous requests it can process. So the less - the better.
And definitely no one may answer you if 5 is much or not in your case because only you know the details. In some cases 5 and even 50 is not much, in some cases even 1 additional request can create performance issues
Upvotes: 2