When an XMLHttpRequest is in "pending" state (in Chrome) does that time count towards it's timeout duration?

1.5k Views Asked by At

If I send out 100 XMLHttpRequests requests with a 1 second timeout that take 1 second for the server to respond, will most of those requests timeout?

1

There are 1 best solutions below

0
On

I ran a test with the following code (https://gist.github.com/anonymous/ba0fc7967829d7d0841d) and it turns out that yes - when a request is in the pending state that does count towards the XHR's timeout period.

That means if you want to timeout based on the server's connection being slow you'd need to set that up yourself.