This article is more than 1 year old
Cloudflare gives websites their marching orders to hasten page rendering automatically
Adjustments to HTTP/2 Prioritization allow faster delivery of web resources
Cloudflare figures it has fixed the web, at least insofar as speedy page loading on its network is concerned.
The content delivery biz on Tuesday revealed changes to its HTTP/2 Prioritization implementation that make websites load page resources – images, scripts, text and the like – more efficiently.
"It's rare to have the opportunity to move the needle so dramatically, so quickly," said co-founder and CEO Matthew Prince, in a phone interview with The Register. "You don't typically get 50 per cent improvements with one change."
The HTTP/2 specification was created to make the web faster. As described in the specification approved in 2015, "HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection."
Where HTTP/1 supports connections that allow one resource request at a time and the server tries to respond as quickly as possible, HTTP/2 allows the browser to ask for multiple resources and to provide information about the preferred order of delivery. Assuming the server understands how to comply – some don't – HTTP/2 presents web pages parts so they can be assembled and presented by the browser with minimal delay.
Each browser implements its own prioritization logic to figure out the order it should load page elements. "Chrome is the best of the various browser that exist and even it isn't perfect," said Patrick Meenan, a Cloudflare engineer who used to work on web performance at Google, in a phone interview with The Register.
Firefox is pretty good too; Safari is less so and Edge doesn't support prioritization at all, though that will change once the Chromium-based version of Edge arrives.
To help people understand how browsers handle page loading, Cloudflare has published an animated .gif that illustrates the differences.
Cloudflare calls its contribution Enhanced HTTP/2 Prioritization, which Meenan explained is basically some low-level network plumbing on the server side to provide the ability to adjust the order in which responses get handled. Available through its customer dashboard as an optional setting in the Speed tab, it overrides browser default settings with a more efficient scheduling scheme that can result, it's claimed, in website load time improvement of as much as 50 per cent.
And through its serverless execution environment, Cloudflare Workers, customers can refine resource prioritization further to meet specific requirements.
Sick of bandwidth gouging? Cloudflare,
Google, Microsoft, IBM have some good news
"What's especially exciting, for the first time this now allows site owners to programmatically say this image is my hero image, make sure it's a high priority image," explained Prince. "It gives site owners much more control over how resources are loaded."
Cloudflare has also extended its HTTP/2 Prioritization improvements to image rendering, through a capability called HTTP2 Progressive Streaming. It's a technique that further improves the page load experience by rendering images through ongoing detail enhancement rather than displaying the image only once it has been fully loaded.
As an added bonus, taking advantage of HTTP/2 requires that websites send resources over HTTPS rather than insecure HTTP. "If you're not encrypting your pages, you're doing it wrong," said Prince.
While Enhanced HTTP/2 Prioritization is currently only available to those using Cloudflare's network, Prince contends Cloudflare's example may encourage other vendors to implement similar improvements. "Now that we've shined a light on this as an issue, we would expect other people to do that work," he said. ®