4

I have a two column UI where the both columns are filled 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 can see that they both execute in less than 0.01 sec each. Yet, firebug tells me that the load time for them are 0.4 - 1 sec. , it is also apparent that the loadtime is too long just by looking at it.

Also note that there is not that much data beeing sent, so it is not transfer time.

Any ideas what can cause this?

Is it a problem caused by ajax? Will JQuery queueing up requests in some way?

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

The cached calls are ProjectTodo.aspx and GetHappenings.aspx Both execute sub 0.01 sec on server side.. and not that heavy result either

Roger Johansson
  • 22,764
  • 18
  • 97
  • 193

2 Answers2

2

There is a limit in the number of concurrent requests you can do for a given domain.

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

The difference between the server side execution and the time of the complete request/response can also be in the dns resolution. You can try to do just one ajax request to find out if the problem is in the concurrence or in this single request.

Community
  • 1
  • 1
MazarD
  • 2,759
  • 2
  • 22
  • 33
1

Is firebug reporting that the data has come back within a certain time? Rather than the length of the call in jQuery. The Net tab should give you the info you require.

If you're making a lot of calls to the same domain (perhaps images or scrips loading in the background), the browser by default will throttle the number of concurrent HTTP requests. You could try subdomaining if the number of HTTP requests is the limiting factor. Otherwise you'll have to look at your jQuery code.

Jeff Watkins
  • 6,343
  • 16
  • 19