Server Push

Note: Before explaining how to set it up, I ask you to carefully analyze whether you need this. Server Push benefits mostly clients which can prioritize resource fetching to optimize other flows (p.ex.: browser rendering cycle), but don’t help much in server-to-server HTTP interactions. In fact, in order to reliably support Server Push, one has to throttle request concurrency.

That being said, here’s how you can use it. Remember that HTTP/2 PUSH streams are only accepted if the pushed request is in the pendinng list of requests:

http = HTTPX.plugin(:push_promise)
responses = http.get("", "")
# request
# server sends PUSH frame for
# server sends PUSH frame for
# client accepts first stream
# client rejects second stream

Next: Upgrade