Slow response from multiple ajax calls

I have a two-column interface where both columns are populated with news from two different ajax calls using jQuery. There are also other ajax calls for other things on the page.

Both services are cached on the server side, I see that they both run in less than 0.01 sec . However, firebug tells me that the boot time for them is 0.4-1 s. It’s also obvious that the loading time is too long just by looking at it.

Also note that not much data has been sent, so this is not a transmission time.

Any ideas what might cause this?

Is this ajax caused problem? Will jQuery ask queries incorrectly?

[Edit] Added screenshot of firebug net tab enter image description here

Cached calls are ProjectTodo.aspx and GetHappenings.aspx. Both perform sub 0.01 s on the server side .. and not this heavy result either

+4
source share
2 answers

Is firebug reporting that the data returned within a certain time? Instead of call length in jQuery. The Network tab should provide you with the information you need.

If you make many calls to the same domain (possibly images or loading scripts in the background), the browser will by default throttle the number of simultaneous HTTP requests. You can try a subdomain if the number of HTTP requests is a limiting factor. Otherwise, you will have to look at jQuery code.

+1
source

Limit the number of simultaneous requests you can make for a given domain.

You can find more information here: How many concurrent AJAX requests (XmlHttpRequest) are allowed in popular browsers?

The difference between server-side execution and the full request / response time can also be in dns resolution. You can try to execute only one ajax request to find out if there is a problem in the consent or in this single request.

+2
source

Source: https://habr.com/ru/post/1437742/


All Articles