Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issuing multiple requests using HTTP/1.1 Pipelining

When using HTTP/1.1 Pipelining what does the standard say about issuing multiple requests without waiting for each request to complete? What do servers do in practice?

I ask because I once tried writing a client which would issue a batch of GET requests for multiple files and remember getting errors. I wasn't sure if it was due to me incorrectly issuing the GET's or needing to wait for each individual request to finish before issuing the next GET.

like image 371
Robert S. Barnes Avatar asked Apr 19 '10 07:04

Robert S. Barnes


1 Answers

Pipelining is just that -- having more than one request "in flight" on a single connection.

On the open Internet, pipelining isn't very common, because a few servers and intermediaries don't get it right, and the consequences of messing up pipelining can be severe (e.g., mixing up responses to two different users).

Keep in mind that only HTTP/1.1 supports pipelining; if you have a HTTP/1.0 server, or a 1.0 proxy in the middle, it probably won't work.

Also, pipelining can only be used on "idempotent" methods like GET and HEAD; it isn't allowed for POST, etc.

See: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-p1-messaging-09#section-7.1.2.2

like image 151
Mark Nottingham Avatar answered Oct 15 '22 06:10

Mark Nottingham