3. We’ve been hacking around some of the limitations
https://www.flickr.com/photos/rocketnumber9/13695281
4. Each TCP connection only supports one request at a time*
https://www.flickr.com/photos/39551170@N02/5621408218
*HTTP Pipelining is broken in practice
5. So browsers allowed us to make more requests in parallel
Very Old browsers - 2 parallel connections
Today’s browsers - 4 plus connections
6. To make even more parallel requests we split resources across hosts
www.bbc.co.uk!
static.bbci.co.uk!
news.bbcimg.co.uk!
node1.bbcimg.co.uk
7. Increasing the risk of network congestion and packet loss
https://www.flickr.com/photos/dcmaster/4585119705
8. Every request has an overhead
https://www.flickr.com/photos/tholub/9488778040
17. and mush images together as sprites
To get just one sprite …
18. and mush images together as sprites
Browser must download and
decode the whole image
To get just one sprite …
19. We override the browser’s priorities
https://www.flickr.com/photos/skoupidiaris/5025176923
20. Embed binary* data using DataURIs
url(data:image/
png;base64,iVBORw0KGgoAA
AANSUhEUgAAABkAAAAZCAMAA
ADzN3VRAAAAGXRFWHRTb2Z0d
2FyZQBBZG9iZSBJbWFnZVJlY
WR5ccllPAAAAAZQTFRF/
wAAAAAAQaMSAwAAABJJREFUe
NpiYBgFo2AwAIAAAwACigABt
nCV2AAAAABJRU5ErkJggg==)
=
*dataURIs can be text too e.g. SVG
28. • HTTP methods, status codes and semantics remain the same!
• Binary headers!
• Header compression!
• Multiplexed!
• Server can push resources
HTTP/2
45. Many opportunities for server push
HTML
CSS
DOM
CSSOM
Render!
Tree
Layout PaintJavaScript
Fonts and background
images discovered
when render tree builds
Could we push them?
55. Choose your server carefully…
Does it respect stream and connection flow?!
Does it support dependencies and weights?!
Does it support server-push?!
!
How does it help optimisation?
56. No content until DNS, TCP and TLS negotiation complete
Efficient TLS is Important
Session Resumption, Certificate Stapling and improvements in TLS v1.3 all help
57. Efficient TLS is Important
istlsfastyet.com www.ssllabs.com/ssltestBulletproof SSL and TLS
Ivan Ristic