The document discusses how best practices for performance tuning with HTTP/1.1 may need to be re-thought with the introduction of HTTP/2. It provides an overview of how HTTP/2 addresses limitations of HTTP/1.1 like head-of-line blocking through features like multiplexing, binary framing, header compression and server push. It recommends approaches like keeping HTTP requests low and caching resources while avoiding past practices like excessive domain sharding or image sprites that are no longer needed with HTTP/2.
19. Data Transferred In Streams as Frames
Stream Initiated by client => Odd numbers
Stream Initiated by Server => Even Numbers
Stream_id = 0x0 => Connection Control Messages
Stream_id 0x1 => http1.1 requests upgraded to h2
26. Stream Priority
• Based on Dependencies and Weights
• Weight [1 - 256]
*
A
10
B
1
*
A
10
B
1
27. Prioritization in Firefox
• Prioritization is an advisory hint to the server
Server can ignore if necessary
https://www.youtube.com/watch?v=yURLTw
Z3ehk
32. Re-Thinking Perf Best Practices
Dos
• Keep HTTP requests low
• Continue to Compress
• Cache Resources on Client
• Server Push (cautiously)
• Use a server that supports
HPACK & Stream Priority
• Bundle upto 3 files
(lib / site-global / page)
Don’t
• Avoid Excessive Domain
Sharding
• Image Sprites may not be
necessary
• No Excessive in-lining
When http1.1 came out… Image slicing was a critical piece of our web development.
Where we would take up 1 single image and cut it into pieces and put them into tables.
Because smaller the asset the faster it would load.
We have to reduce the HTTP requests.
CSS and JS bundling doesn’t make logical sense.
Many of us did it just because we needed a better Yslow Score or Google Page Speed Index.
Many of us avoided doing it because it would break our page.
Latency and RTT are the bigger performance killers.
Beyond a point bandwidth doesn’t matter.
More importantly more number of requests leads to more page weight due to the additional overhead of header bytes sent with every request especially things like the user-agent, and cookies.
The reason we kept sending the headers with each asset was because http is stateless, http2 is also still a stateless protocol.
But there is a separate spec that talks about compressing the headers using HPACK and Hoffman Code
Hpack uses a look up table for the most common request header and puts them into a static table.
61 Header values as a part of the static table.
Dynamic entries can be added from #62 onwards