15. New Problems
● Web pages need a build system (Sprites, Bundles)
● Web pages need run-time handling (Inlining)
● Inlining vs Caching (repeated sends, critical path)
● Concat vs Caching (one change, all new)
● More domain names, more certificates, more link rewriting
● (No problem with keep-alive, though)
16. Serving a Web page
became complicated
for developers (not servers)
26. We need TLS
● h2 is binary
● Avoid hops, bypass proxies
● Employ HTTPS everywhere
27. TLS Problems
● Certificates for every domain: buy (or automate Let’s
Encrypt)
● Make sure it is used! Redirects, HSTS
● Fix all mixed content (3rd party, too!): change URLs, use CSP
(This may be the major pain point when migrating to h2)
28. Request Bursts
● h1 HOL and 6 connections == “cooperative throttling”
● Without inlining/sprites/bundles -> even more requests
● Coming in at the same time
● Be prepared for 50+ simultaneous requests from one client
● Protect your application servers
● Employ a reverse proxy (e.g Varnish)
29. More Connection Problems
● Connections need a looooong life-time
● Packet loss severely impacts h2 (Slow start prob is back!)
● h2 is intended only for the last mile (client-end)
● De-couple TLS/h2 from application server
● Avoid TCP balancing h2
32. TCP head-of-line blocking breaks Multiplexing
● Requests come in at once
with different priorities (CSS: highest, images: low)
● TCP Buffers are serialized: FIFOs
● The fastest responses fill up the buffer (Cache Hits)
● Important content may get delayed
34. h2 waterfalls are tricky to read
TTFB is the first byte
received by the client.
The server may have
sent it much earlier.
All responses were
generated in the
same second.
35. To multiplex or not to …?
● Most file formats are not usable while in-flight
● JS is executed after download
● CSS is applied after download
● Font is used after …
36. To multiplex or not to …
● Is multiplexing responses useless?
● No!
● Progressive JPEG is rendered in-flight!
○ Hello, Speed Index!
○ (There is no “progressive WebP”)
● Response Header Frames are often multiplexed
37. Multiplexed Response Header Frames
H1 H2 H3 D1 D1 D1 D1 D2 D2
Serialized Response Data Chunks
but no “parallel” download
fast TTFB (for assets) Server
38. h2 waterfalls are tricky to read
Response
header frames
are sent one
after another.
Data frames
are not
multiplexed.
39. h2 waterfalls are tricky to read
typical h1
shape
h1 shape
hiding in h2
40. ● Multiplexing is bad
if data is only usable when complete (TTLB)
● Most servers tend not to multiplex
● Exception: h2o server multiplexes more!
● What about Progressive JPEG? :(
To multiplex or not to …
41. WebPageTest and h2
● SpeedIndex favors Multiplexing for JPEG hero images
● SpeedIndex favors Serializing for WebP heros (TTLB)
● FirstInteractive favors Multiplexing/ Prioritization JS before img
● Load Time favors Serializing
● Packet Loss favors HTTP/1 :)
● What metric do you want to fake today?
42. Experiment: Sleepy Images
● Image response delayed by 200ms (varnish)
● Let JS slip in before image payloads block the buffer
● Favors FirstInteractive over SpeedIndex