52. Avoid more than one roundtrip
First Load
• TCP Slow Start - initial congestion window
(initcwnd)
• Linux: 14.6 KiB (10 segments)
• CDNs are playing with different values
53. Deliver ATF in 14.6 KiB
First Load
• Embed all CSS and JavaScript needed
• If space, embed logo and/or low-res images
54. Avoid http to httpS redirect
First Load
• Use HSTS (HTTP Strict Transport Security)
• Header
• Opt-in at hstspreload.org
58. Data Transfer
• Google’s search page: 3% improvement
• YouTube: reduced 30% buffering
• Facebook similar protocol: 2% improvement
• 75% of requests can be optimized
QUIC
84. Embrace Responsive Images
Data Transfer
• Not just 3 versions of your image
• 65% of the traffic is for images (HttpArchive)
• 84% improvement creating n versions (ScientiaMobile)
94. Meet HTTP Client Hints
Images
• Browser will expose data to the server
<meta http-equiv="Accept-CH"
content="DPR, Viewport-Width, Downlink, Device-Memory”>
HTML
100. Consistent Frame Rate and
Response Times
User Experience
• Don’t execute JS for more than 50ms
• Use LongTask API for detection
• Use WebWorkers or requestIdleCallback
101. Avoid calculations and repaints
User Experience
• Promote animated layers to the GPU
CSS will-change
• Limit browser’s ability to style, layout and paint
CSS Containment
104. Know about the context
User Experience
• Client-side Performance APIs
• Network Information API
• Device Memory Client Hint
• Save-Data Client Hint