2 Answers
2

No, it's still the client who has to make the initial request. With push, the connection will be kept open on both the server and client (normally, the server closes the connection when the response is finished). The server will this way be able to send multiple responses on a single request instead of only one. The client can process each response individually instead of waiting for the "last byte" to be arrived before processing the response.

This construct allows that there can be a server-definied time interval between multiple responses on a single request. This construct also allows that the server can immediately send a response on a server-side event instead of waiting for a client-side event (like as in poll).

Long polling sends multiple requests over same connection which is a waste of resources (the server has to get hold of the request until a response can be sent and after that, the client sends another new request again which get hold as well, etc). Server push is multiple responses to a single request (the server doesn't need to get hold of the initial request, the connection is already open and the client understands how to deal with multiple responses).
–
BalusCJan 30 '13 at 14:22

Thanks for your precisions ! Another question : HTTP 2.0 is a "fork" of the SPDY protocol (wich is already done and used), does SPDY implement this kind of server push feature ?
–
EpocJan 30 '13 at 14:50

The HTTP2 push mechanism is not a generic server push mechanism like websocket or server sent events.

It is designed for a specific optimisation of HTTP conversations. Specifically when a client asks for a resource (eg index.html) the server can guess that it is going to next ask for a bunch of associated resources (eg theme.css, jquery.js, logo.png, etc. etc.) Typically a webpage can have 10s of such associated requests.

With HTTP/1.1, the server had to wait until the client actually sends request for these associated resources, and then the client is limited by connections to only ask for approx 6 at a time. Thus it can take many round trips before all the associated resources that are needed by a webpage are actually sent.

With HTTP/2, the server can send in the response to the index.html GET push promises to tell the client that it is going to also send theme.css, jquery.js, logo.png, etc. as if the client had requested them. The client can then cancel those pushes or just wait for them to be sent without incurring the extra latency of multiple round trips.