
Accelerating Node.js Applications with HTTP/2 Server Push - jgrahamc
https://blog.cloudflare.com/accelerating-node-js-applications-with-http-2-server-push/
======
puppetmaster3
Does this tech sense to someone?

For example, while I'm playing one youtube video, they would download the next
one.

smh.

~~~
BillinghamJ
No it would be used for cases like sending you the CSS and JS for the page,
before the browser has actually started to parse the HTML.

It simply means you can reduce the latency of fetching resources which are
referred to within the document.

It wouldn't really make sense to use this for something like YouTube videos -
that's more application level rather than the HTTP level.

~~~
scaryclam
That sounds nice and all, but most static files have caching done on them, so
it seems like this tech may (currently) be a solution in search of a real
problem.

~~~
niftich
HTTP/2 Server Push is a large micro-optimization that requires a lot of effort
(as in, server-side logic, and in some cases, client-side code) to use
properly.

The Chromium team, employed by one of the largest backers of HTTP/2 Push,
recently did a thorough analysis (excellent read) [1], which recommends the
following best practices; paraphrased, commentary mine:

[A] watch and aggressively respond to network utilization

[B] construct a dependency graph of resources _(presumably by actually parsing
the HTML on server-side, or beforehand out-of-band and store it some other
place)_

[C] have the client communicate the state of its cache! _(there 's an RFC
already being proposed for this [2], and some software already implements it
or something similar [3][4])_

[D] have custom, conditional logic for cookies

\----

[1]
[https://docs.google.com/document/d/1K0NykTXBbbbTlv60t5MyJvXj...](https://docs.google.com/document/d/1K0NykTXBbbbTlv60t5MyJvXjqKGsCVNYHyLEXIxYMv0/edit?pref=2&pli=1)
[2] [https://tools.ietf.org/html/draft-ietf-httpbis-cache-
digest-...](https://tools.ietf.org/html/draft-ietf-httpbis-cache-digest-00)
[3] [https://mariusgundersen.net/module-
pusher/](https://mariusgundersen.net/module-pusher/) [4]
[https://h2o.examp1e.net/configure/http2_directives.html#http...](https://h2o.examp1e.net/configure/http2_directives.html#http2-casper)

