Server Push has a use case for web APIs. I just published a benchmark showing that under certain conditions APIs using Server Push (such as APIs implementing the
https://vulcain.rocks specification) can be 4x times faster than APIs generating compound documents (GraphQL-like):
https://github.com/dunglas/api-parallelism-benchmarkThey key point for performance is to send relations in parallel in separate HTTP streams.
Even without Server Push Vulcain-like APIs are still faster than APIs relying on compound documents thanks to Preload links and to HTTP/2 / HTTP/3 multiplexing.
Using Preload links also fixes the over-pushing problem (pushing a relation already in a server-side or client-side cache), some limitations regarding authorization (by default most servers don't propagate the Authorization HTTP header nor cookies in the push request), and and is easier to implement.
(By the way Preload links were supported from day 1 by the Vulcain Gateway Server.)
However, using Preload links introduce a bit more latency than using Server Push. Does the theoretical performance gain is worth the added complexity? To be honest I don't know. I guess it doesn't.
Using Preload links combined with Early Hints (the 103 status code - RFC 8297) may totally remove the need for Server Push. And Early Hints are way easier than Server Push to implement (it's even possible in PHP!).
Unfortunately browsers don't support Early Hints yet.
- Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=671310
- Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1407355
For the API use case, it would be nice that Blink adds support of Early Hints before killing Server Push!