I
I
igor21442020-10-17 20:04:43
Web servers
igor2144, 2020-10-17 20:04:43

Long polling HTTP request blocking responses to other HTTP requests?

Good evening, as far as I know, the HTTP protocol provides for the server to respond to client requests in a pipelining format. That is, if the client sends: request1, request2, request3, then the server responds to this in sequence: response1 (to request1), response2 (to request2) and response3 (to request3).
In this case, it turns out that a Long Polling request will block all responses to subsequent requests, is that right?

For example, the client sends: , the server does not respond to it until new data appears or a timeout passes, and at this time any other requests from the client to the server will also not receive a response (for example, the user presses a button), so as the server has not yet responded to the Long-Polling request.

Please explain if it's not difficult

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2020-10-17
@Stalker_RED

Browsers are able to make parallel requests.
The maximum number of requests is configurable, by default something like this

| Browser              | Connections per Domain         | Max Connections                |
| -------------------- | ------------------------------ | ------------------------------ |
| Chrome 81            | 6 [^note1]                     | 256[^note2]                    |
| Edge 18              | *same as Internet Explorer 11* | *same as Internet Explorer 11* |
| Firefox 68           | 9 [^note1] or 6 [^note3]       | 1000+[^note2]                  |
| Internet Explorer 11 | 12 [^note4]                    | 1000+[^note2]                  |
| Safari 13            | 6 [^note1]                     | 1000+[^note2]                  |

[^note1]: tested with 72 requests , 1 domain(127.0.0.1)
[^note2]: tested with 1002 requests, 6 requests per domain * 167 domains (127.0.0.*)
[^note3]: when called in async context, eg in callback of setTimeout, + requestAnimationFrame, then... [^ note4 ]: of which the last 6 are follow-ups (2,4,6 available at
0.5s,1s,1.5s respectively) -in simultaneous requests is also configurable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question