Difference between HTTP pipeling and HTTP multiplexing with SPDY
Thanks to Google and Stack Overflow, I think I understood the difference between regular HTTP pipelining and HTTP multiplexing (e.g., with SPDY), so I made the diagram below to show the differences between pipelining and multiplexing based on three regular HTTP requests.
My two questions are:
- Is the image correct?
- Is it true that if pipelining would not have the head-of-line blocking problem it would be as fast as HTTP multiplexing? Or did I miss an additional difference?
It's not incorrect, but there is an important aspect it omits. HTTP requires that you deliver the entire response before any other request can proceed. What you're showing in the diagram is correct in the sense that with SPDY we can finally break the "head of line" requirement and deliver the responses as they become available. However, we also don't have to wait for any request to complete entirely.
Imagine two requests, both several kb's in size: each request will have multiple packets, call them [r1p1, r1p2]
and [r2p1, r2p2]
. HTTP requires that pN's arrive in exact order. SPDY, on the other hand allows us the following: [r2p1, r1p1, r1p2, r2p2]
.
It's also worth mentioning that with SPDY we can use request priorities to hint the server which requests should take precedence, even if it arrives later on the wire (amongst half a dozen other great features).