3 ms·
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.
by niftich 10y ago
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/1K0NykTXBbbbTlv60t5MyJvXjqKGsCVNYHyLEXIxYMv0/edit?pref=2&pli=1 https://docs.google.com/document/d/1K0NykTXBbbbTlv60t5MyJvXj... [2] https://tools.ietf.org/html/draft-ietf-httpbis-cache-digest-00 https://tools.ietf.org/html/draft-ietf-httpbis-cache-digest-... [3] https://mariusgundersen.net/module-pusher/ https://mariusgundersen.net/module-pusher/ [4] https://h2o.examp1e.net/configure/http2_directives.html#http2-casper https://h2o.examp1e.net/configure/http2_directives.html#http...