Improve Performance with HTTP/2 Stream Prioritization
The introduction of the HTTP/2 protocol marked a significant advancement in addressing the critical performance constraints of its predecessor. Unlike HTTP/1, which managed only a single response at a time, HTTP/2 embraced a more efficient approach, leveraging features such as stream prioritization. This evolution reduced latency, improved Core Web Vitals (CWV) metrics, and elevated overall user experience (UX).
What is HTTP/2 stream prioritization?
HTTP/2 stream prioritization is a feature that allows the assignment of priority levels to individual resources, facilitating the optimization of the order in which the server delivers resources to the client. This ability is essential for web pages with multiple resources, such as images, scripts, and style sheets, as it provides a method for critical content to be delivered promptly.
However, the way HTTP/2 signals request priorities is complicated, causing inconsistency among implementations. This complexity has led to various approaches and expressions of priorities, making it hard to establish a standard method. Even today, many HTTP/2 implementations have issues, and some are still not fully complete.
More details about HTTP/2’s complex “Prioritization Tree” can be found in this deep-dive article by Akamai Senior Technical Solutions Architect and IETF contributor, Robin Marx.
Changes on Akamai’s platform
Although the previous implementation of HTTP/2 stream prioritization effectively handled specific use cases, it also introduced delays in certain scenarios.
One such instance surfaced during a webpage analysis — a low-priority object was positioned between two high-priority objects. Further investigation determined that the algorithm responsible for sorting objects and ensuring priority placement was highly CPU-intensive, which increased latency by up to three times.
The new implementation is available now
To overcome performance challenges, the worldwide rollout of the changes to enable the new HTTP/2 stream prioritization was completed. The feature is enabled for all HTTP/2 traffic — it requires no further customization from customers in their configurations other than enabling HTTP/2.
HTTP/2 stream prioritization enhances the delivery of high-priority resources, like images, style sheets, and scripts. Once the server starts serving, it prioritizes them before addressing other objects. This means that you can improve the CWV metrics for multi-object pages simply by enabling HTTP/2 and leveraging this new feature. However, there is a delay in writing the first byte to the socket for lower-priority requests, leading to a slight degradation of the overall turnaround time (TAT) metric.
Performance benefits
We observed that HTTP/2 stream prioritization improves download times, specifically the time to last byte (TTLB), for high-priority image objects by 30%.
This improvement translates into notable enhancements in key metrics such as Largest Contentful Paint (LCP; Table 1) and First Contentful Paint (FCP; Table 2) — and measurements on specific websites showed the reduction of their values by 100 to 300 milliseconds (ms) at both the 75th percentile and 90th percentile.
Improvements on LCP
Percentiles |
HTTP/2 prioritization disabled (ms) |
HTTP/2 prioritization enabled (ms) |
Gain |
|
---|---|---|---|---|
Milliseconds |
Percentage |
|||
50th percentile |
1643 |
1536 |
107 |
7% |
75th percentile |
2722 |
2571 |
151 |
6% |
90th percentile |
1643 |
1536 |
107 |
4% |
Table 1: LCP comparison in milliseconds when enabling HTTP/2 prioritization
Improvements on FCP
Percentiles |
HTTP/2 prioritization disabled (ms) |
HTTP/2 prioritization enabled (ms) |
Gain |
|
---|---|---|---|---|
Milliseconds |
Percentage |
|||
50th percentile |
1452 |
1324 |
128 |
9% |
75th percentile |
2000 |
1842 |
158 |
8% |
90th percentile |
2833 |
2500 |
333 |
12% |
Table 2: FCP comparison in milliseconds when enabling HTTP/2 prioritization
We see the LCP improvements in the real user monitoring (RUM) data collected in Akamai mPulse, which is our RUM solution that enables companies to understand site experience from the users’ perspective. It's worth noting that the data relates exclusively to websites hosted on Akamai, ensuring that our analysis provides the most accurate insights into the effects of our changes.
For more details on how mPulse can help you measure user-centric metrics, such as CWV, and improve overall UX, check out our Measuring User Experience with Real User Data blog post.
Summary
In this post, we explained the reasons behind Akamai's decision to reimplement HTTP/2 stream prioritization. This decision aligns with our ongoing commitment to provide our customers with the best performance possible.
We recognize the crucial role this feature plays in shaping critical metrics, such as CWV. Through this implementation, we aim to make the UX even better for our customers.
Learn more
The new implementation of HTTP/2 stream prioritization complements the previous improvements on parallel execution of multiplexed requests.
If you found this information useful, you can learn more about HTTP/2 tips and best practices by checking out this documentation or by contacting our support team for further assistance.