Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

added 127 characters in body
Source Link
T.J. Crowder
  • 1.1m
  • 201
  • 2k
  • 2k

You've said you want to make the requests asynchronous; they are (and you don't need async: true, that's the default).

this show the second request can be trigged only after the first request return

No, it shows that the first one completed before the second, not that the second wasn't triggered until the first one completed.

If you're reliably seeing 2 1 3 in repeated tests, that tells you one of two things:

  1. The first request is inherently faster to process than the second — but if you're holding up the processing of urlone for five seconds (and you've verified that), orthen it's not this

  2. The server is serializing them

The server may be serializing them for any of several reasons; what those reasons are depends on the server-side technology and configuration you're using. For instance, some servers will serialize requests for dynamically-generated content that are in the same "session".

You've said you want to make the requests asynchronous; they are (and you don't need async: true, that's the default).

this show the second request can be trigged only after the first request return

No, it shows that the first one completed before the second, not that the second wasn't triggered until the first one completed.

If you're reliably seeing 2 1 3 in repeated tests, that tells you one of two things:

  1. The first request is inherently faster to process than the second, or

  2. The server is serializing them

The server may be serializing them for any of several reasons; what those reasons are depends on the server-side technology and configuration you're using. For instance, some servers will serialize requests for dynamically-generated content that are in the same "session".

You've said you want to make the requests asynchronous; they are (and you don't need async: true, that's the default).

this show the second request can be trigged only after the first request return

No, it shows that the first one completed before the second, not that the second wasn't triggered until the first one completed.

If you're reliably seeing 2 1 3 in repeated tests, that tells you one of two things:

  1. The first request is inherently faster to process than the second — but if you're holding up the processing of urlone for five seconds (and you've verified that), then it's not this

  2. The server is serializing them

The server may be serializing them for any of several reasons; what those reasons are depends on the server-side technology and configuration you're using. For instance, some servers will serialize requests for dynamically-generated content that are in the same "session".

Source Link
T.J. Crowder
  • 1.1m
  • 201
  • 2k
  • 2k

You've said you want to make the requests asynchronous; they are (and you don't need async: true, that's the default).

this show the second request can be trigged only after the first request return

No, it shows that the first one completed before the second, not that the second wasn't triggered until the first one completed.

If you're reliably seeing 2 1 3 in repeated tests, that tells you one of two things:

  1. The first request is inherently faster to process than the second, or

  2. The server is serializing them

The server may be serializing them for any of several reasons; what those reasons are depends on the server-side technology and configuration you're using. For instance, some servers will serialize requests for dynamically-generated content that are in the same "session".

lang-js

AltStyle によって変換されたページ (->オリジナル) /