2 ms·
You just described long-polling: holding the connection open until the response arrives or it times out. Even if you just send push-promises and push-responses
by manigandham 9y ago
You just described long-polling: holding the connection open until the response arrives or it times out.
Even if you just send push-promises and push-responses while keeping the original response stalled (and the browser accepts the response), the client-side JS still has no idea what those requests were or what was loaded.
SSE is the evolution of long-polling so that browsers already include the logic to keep a connection open with streaming updates so that you can avoid all this in the first place.
- Touche 9y agoThis differs from long polling in that http2 doesn't create a new connection. Also long-polling is request and then response, whereas http2 is (like websockets) full duplex.