5

I make asynchronous call for same URL for multiple times, But the response came as sequentially. Please see the attached image, The request has been started only after first request completes, the same happening for subsquent requests.

enter image description here

But If the URL is different the responses are not sequential. Please confirm me if one URL is being requested, wouldn't firefox make another request for same URL?

thirtydot
  • 224,678
  • 48
  • 389
  • 349
Selvakumar Ponnusamy
  • 5,363
  • 7
  • 40
  • 78
  • Did you verify that your interface is able to handle multiple requests ? – fyr Feb 08 '12 at 08:07
  • I believe duration bar shows various stages, hovering over it shows DNS lookup and connect, if it was the server-side interface that was not able to support concurrency you'd see a green slab for the second request starting roughly the same point. – Mâtt Frëëman Feb 08 '12 at 08:10
  • Please correct if my understanding is wrong on this. When I hover the status bar for the second request, "+1.44s Started" which means it starts the request after completes the first request which completes in 1.44s. But if I different URLs, every request has Started time as "0" – Selvakumar Ponnusamy Feb 08 '12 at 08:22
  • Chrome 22 also has this behavior. – Sam Aug 24 '12 at 19:00
  • Chrome 23 also has this behavior. – Rag Feb 12 '13 at 23:37

2 Answers2

8

Necko's cache can only handle one writer per cache entry. So if you make multiple requests for the same URL, the first one will open the cache entry for writing and the later ones will block on the cache entry open until the first one finishes. There's work ongoing to rearchitect the cache to remove this restriction.

Boris Zbarsky
  • 34,758
  • 5
  • 52
  • 55
1

Generally browsers will have a limit to how many concurrent requests they will serve to a particular hostname, in the old days this was 2, but most browsers have now raised this. Defining a proxy can also affect these limits in some browsers. Again these are enforced client-side. However it should be more than one in any case. It may be possible that Firebug is also reducing the limit, check about about:config for concurrent configurations.

Are you sure you are not waiting until the callback is executed before launching the next request as given you only have one I suspect this what is really happening?

Mâtt Frëëman
  • 1,361
  • 9
  • 20
  • Thanks wtfcoder, I'm very sure that the control is not waiting to make a second request till the callback. But when I see the response in firebug it's sequential. whether firefox would restrict to make a second request for the same URL which is waiting for a response. – Selvakumar Ponnusamy Feb 08 '12 at 08:16