--- url: "https://almanac.httparchive.org/en/2024/http" titulek: "HTTP | 2024 | The Web Almanac by HTTP Archive" h1: "HTTP" popis: "The HTTP chapter of the 2024 Web Almanac covers data on historical versions of HTTP used across the web, as well as the uptick in adoption of HTTP/2 and HTTP/3 from alt-svc and DNS HTTPS records. Additionally, it looks at higher level features that impact HTTP behaviour, such as Resource Hints, 103 Early Hints and the Fetch Priority API." jazyk: "en" kanonicka: "https://almanac.httparchive.org/en/2024/http" drobecky: ["en", "2024"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 20:13:58" znaku: 61278 slov: 9850 kodovani: "utf-8" sha256: "b1870dcdd8e442360e49da9c70af51b07b137dc035dc0f0d8cd0dc1e3242340d" --- Part IV Chapter 18 # HTTP Date published: 2024/12/10 Last updated: 2025/01/02 Written by [Robin Marx](/en/2024/contributors#rmarx) Reviewed by [Barry Pollard](/en/2024/contributors#tunetheweb) and [Chris Böttger](/en/2024/contributors#ChrisBeeti) Analyzed and edited by [Barry Pollard](/en/2024/contributors#tunetheweb) ## Introduction HTTP remains the cornerstone of the web ecosystem, providing the foundation for exchanging data and enabling various types of internet services. It is an actively developed protocol, with the latest version [HTTP/3](https://datatracker.ietf.org/doc/html/rfc9114) standardized a little over two years ago, and new options to enable it recently becoming available, such as the new [DNS HTTPS records](https://developer.mozilla.org/docs/Glossary/HTTPS_RR). At the same time, the web platform has been exposing more and more higher-level features that web developers can use to influence when and how resources are requested and downloaded over HTTP. This includes options like [Resource Hints](https://web.dev/learn/performance/resource-hints) (for example preload and preconnect), [103 Early Hints](https://developer.mozilla.org/docs/Web/HTTP/Status/103) and the [Fetch Priority API](https://web.dev/articles/fetch-priority). In this chapter, we will first look at the current state of HTTP/1.1, HTTP/2 and HTTP/3 adoption, and how their usage has evolved over time. We then consider the new web platform features, to get an idea of how well they’re supported and how people are using them in practice. ## HTTP version adoption Conceptually, getting an idea of how widespread the adoption of HTTP/2 and HTTP/3 is should be easy: just report how often each of the protocol versions was used to load the observed web pages in our dataset. This is exactly what we’ve done in the graph below: Stacked bar chart showing HTTP version usage per website. For desktop, 22% of sites uses HTTP/1.1, 71% uses HTTP/2 and 7% uses HTTP/3. For mobile, 21% uses HTTP/1.1, 70% uses HTTP/2 and 9% uses HTTP/3. Figure 18.1. Adoption of HTTP versions as a percentage of website home pages. While these results might look sensible at first glance, they are actually quite misleading. Indeed, as we’ll see later, in reality HTTP/3 support across the web is closer to 30% instead of the 7-9% reported above. This discrepancy is due to the fact that HTTP/3 has to be discovered before being used, while [the methodology used](./methodology) for the Web Almanac doesn’t really lend itself well to the main discovery option (see `HTTP/3 via alt-svc`). This causes a lot of HTTP/3-capable sites to still be loaded over HTTP/2 and thus HTTP/3 is getting underreported. We will discuss this in more detail below, but for now we will bypass this issue by grouping HTTP/2 and HTTP/3 together into a single label of **HTTP/2+** to at least compare them to HTTP/1.1 in general. As such, we see that only 21-22% of home pages are loaded over HTTP/1.1 in 2024, a marked difference from 2022 [where it was still 34%](../2022/http#http2-adoption) and especially 2020 where there was [basically a 50/50 split](../2020/http#http2-adoption) between HTTP/1.1 and HTTP/2+. However, this is just looking at how the main document (the HTML) of the page is loaded. Another way of looking at HTTP adoption is by looking at the version used for all requests (including subresources and third-parties), which skews the results even more towards HTTP/2+: Stacked bar chart showing HTTP/2+ adoption per request. On both desktop and mobile, 15% of requests are over HTTP/1.1 and 85% over HTTP/2. Figure 18.2. Adoption of HTTP/2 and above as a percentage of requests. This is because many websites will load additional resources from a variety of third-party domains (for example, analytics, plugins/tags, and social media integrations). Due to their scale, these external services often either provide support for HTTP/2+ themselves or make use of a so-called CDN or Content Delivery Network (for example Akamai, Cloudflare or Fastly) that does it for them. In fact, CDNs are used very heavily on the observed websites in our dataset, with a whopping 54% of over 1.3 billion requests in our dataset being served from a CDN! 54% Figure 18.3. The percentage of over 1.3 billion requests in the Web Almanac dataset that use a CDN. These companies are typically at the forefront of implementing new standards and protocols. When they enable a new feature, it becomes available to all their customers, usually causing a fast increase in global adoption. As such, we can see that CDNs are still one of the main drivers of HTTP/2+ adoption, with less than 4% of all CDN requests happening over HTTP/1.1. This is again in stark contrast to requests not served from a CDN node, of which up to 29% still use HTTP/1.1. Stacked bar chart showing HTTP/2 adoption for CDN requests. On both desktop and mobile, 4% of requests are over HTTP/1.1 and 96% over HTTP/2. Figure 18.4. Almost all traffic from CDNs is delivered over HTTP/2+. Combined, these results show that while overall adoption of newer HTTP versions is higher than ever, there are still plenty of sites that are in danger of “being left behind”. These are mostly the (likely smaller) projects that can’t or won’t engage a CDN, but also don’t have the technical know-how or motivation to enable HTTP/2+ themselves at their origins. Conceptually, this makes sense, as the newer versions do have some costs associated with them, both in terms of complexity and—especially for HTTP/3—in terms of CPU usage. And while HTTP/1.1 of course still functions perfectly fine, there might be some performance/efficiency downsides, as only HTTP/2+ allows multiplexing of multiple resources onto one connection, as well as additional features like resource prioritization and header compression. Still, personally I feel it’s good to have freedom of choice on the web, not just in terms of content, but also the tech stacks that are used, and that includes the protocols. Importantly, the current (over)reliance on CDNs (for performance and security) also does have its own downsides, with some people [fearing a “centralization” of the web](https://www.mnot.net/blog/2023/12/19/standards-and-centralization) around a few large companies. I don’t think we’re quite there yet, but [I have written previously](https://pulse.internetsociety.org/blog/the-challenges-ahead-for-http-3) about the worrying fact that it is increasingly only the CDNs/large companies that have the technical know-how to deploy the newer protocols at scale. I don’t know the right answer here, but feel it’s good to highlight both sides! However you feel about this, it is clear that CDNs already make up a large part of the web today, and that they are driving adoption of the newer HTTP versions. Let’s thus move away from the philosophical back into the (deeply) technical now, and explore why exactly the Web Almanac dataset is only seeing low percentages of HTTP/3 being used! ## Discovering HTTP/3 support Measuring HTTP/3 adoption can be challenging because most modern browsers and clients will not try HTTP/3 the first time they load a page from a domain they haven’t seen before. The reasons why are complex and were explained in detail in previous Web Almanacs ([2020](../2020/http#deploying-and-discovering-http3) and [2021](../2021/http#negotiating-http3)). The short version is that it could take the browser a (very) long time to fall back to HTTP/2 (or HTTP/1.1) if HTTP/3 is not available for the target domain—for example if the server doesn’t support it yet, or if the network is blocking the protocol. This is less of a problem for HTTP/2 and HTTP/1.1, as they both run over the TCP protocol. If the server doesn’t support HTTP/2, it can just continue with HTTP/1.1 over the existing TCP connection the browser set up, getting an “instant fallback”. HTTP/3 however is different, as it replaces TCP with [a new transport protocol called QUIC](https://www.smashingmagazine.com/2021/08/http3-core-concepts-part1/) which in turn runs over the UDP protocol. If the browser *only* opens a QUIC+HTTP/3 connection to a server that doesn’t support it, that server wouldn’t be able to fall back to HTTP/2 or HTTP/1.1, since that’s only possible over TCP, not QUIC/UDP. It would have to wait for the HTTP/3 connection to timeout (which can take several seconds) and only then open a new TCP connection for HTTP/2 or HTTP/1.1, which would be very noticeable for the end users. To prevent users suffering this potential delay, the browser will in practice only try HTTP/3 if it’s 100% sure the server will support it. But how can it be 100% sure? Well, if the server/deployment explicitly tells the browser it supports HTTP/3 first, of course! There are two main ways of doing this: 1. **The `alt-svc` HTTP response header** : the HTTP server advertises HTTP/3 support when a resource is requested over HTTP/2 or HTTP/1.1 2. **The DNS HTTPS resource record** : the DNS server indicates HTTP/3 support during name resolution, before connection establishment The first option is by far the most popular today, but has the downside that it first needs a “bootstrapping” connection over HTTP/2 or HTTP/1.1 to discover HTTP/3 support. The second option removes this downside by putting the information directly in the Domain Name System (DNS), which resolves before the first HTTP connection is even made. It is however much newer and thus less supported at the moment of writing. To get a good idea of real HTTP/3 support in the Web Almanac dataset, we need to consider both separately, as they will give conflicting results. ### HTTP/3 via `alt-svc` As discussed above, if the browser hasn’t connected to a domain before, it will only try HTTP/2 or HTTP/1.1 over TCP, as those are most likely to be supported. For each HTTP/2 or HTTP/1.1 response, the server can then send along a special `alt-svc` HTTP response header, indicating it is guaranteed to support HTTP/3 as well—at least for a specified timeframe: the `ma` (max-age) parameter. Screenshot of the Chrome devtools networking panel, with the Headers tab showing the `alt-svc` HTTP response header supporting HTTP/3 on UDP port 443 with ALPN value `h3` and `max-age` of 26 hours for `www.akamai.com` Figure 18.5. `alt-svc` response header example. `alt-svc` stands for **Alternative Services**: you’re currently using the HTTP/2 service, and there’s also an HTTP/3 service available (usually at UDP port 443). From then on, when the browser needs a new connection to the server, it can try to establish it over HTTP/3 as well! Using this mechanism thus means that HTTP/3 is typically only used from the second page load of a site onward, as the first load will happen over H2 or HTTP/1.1, even if the server supports HTTP/3. And that is the crux of the issue here, as the Web Almanac only measures the first page load by design. In order to make results comparable and fair across websites, we want to load each page with a fresh browser profile and nothing in the HTTP/file/DNS/alt-svc/… caches. As such, the `alt-svc` mechanism is conceptually useless in our methodology, as we’d only use the initial HTTP/2 connection and never get to HTTP/3. This is why measuring HTTP/3 adoption directly by protocol used in our dataset (as we did in the first image above) is misleading, with HTTP/3 getting underreported. Let’s now look purely at how HTTP/3 support is being announced via `alt-svc` to get an idea of how much support sites claim to have, even if it doesn’t actually show up in our dataset: Bar chart showing the percentage of home pages that announce HTTP/3 support via the alt-svc response header over time. In 2022, 18% of both desktop and mobile pages signaled HTTP/3 support, up to 20% for desktop and 21% for mobile in 2023, and 26% for desktop and 28% for mobile in 2024. Figure 18.6. HTTP/3 support (via `alt-svc`) has increased steadily since 2022. When we [last looked at HTTP/3 support](../2022/http#http3-support) in June 2022, the protocol wasn’t even fully standardized yet. Still, due to early deployments from some large players, around 18% of sites in the HTTP Archive dataset indicated they had support for HTTP/3. Now, two years later, we can see that support for the new protocol has steadily risen, up to 26% (desktop) to 28% (mobile), a near 10% overall increase. If that still seems low, it’s actually quite similar to HTTP/2’s evolution, which equally saw [around 30% uptake in its second year](https://httparchive.org/reports/state-of-the-web#h2) after standardization (2017). It is somewhat interesting to see that mobile home pages advertise a little better support for HTTP/3 than their desktop counterparts. This can potentially be explained by the fact that HTTP/3 will mainly deliver benefits over mobile/cellular networks (and so site owners might want to mainly enable it for that) and because some corporate environments still tend to block HTTP/3 on their networks (making it less interesting to enable for desktop clients). Stacked bar chart showing which percentage of HTTP/3 requests came from a CDN or not. For desktop, only 14% of HTTP/3 requests was not served from a CDN, while for mobile this was 15%. Figure 18.7. HTTP/3 support is driven mainly by CDNs. Similar to HTTP/2+ above, the support for HTTP/3 comes mainly from the CDNs, but in a quite extreme form in my opinion: around 85% of all HTTP/3 responses seen in our dataset came from a CDN. This compares to around 55% of all HTTP/2+ requests. This indicates that today very few website owners are self-deploying HTTP/3 at their origin and re-emphasizes my point from above that fast adoption of new technologies might (sadly) become a large-company-only thing. This is not entirely unexpected however; a lot of the popular “off the shelf” web servers do not have stable, mature, on-by-default HTTP/3 support yet-including projects like NodeJS, Apache and nginx. Running a scalable HTTP/3 deployment that uses some of the protocol’s more advanced features, like connection migration and 0-RTT, is far from easy. Still, I hope to see more people self-hosting HTTP/3 in the near future. One important remark to make here is that not all CDNs show equally high HTTP/3 support: | HTTP/3 `alt-svc` | CDN | | --- | --- | | > 90% | Facebook, Automattic, jsDelivr | | 50% - 90% | Cloudflare, Cedexis | | 10% - 50% | Google, Amazon Cloudfront, Fastly, Microsoft Azure, BunnyCDN, Alibaba, CDN 77 | | 1% - 10% | Akamai, Sucuri Firewall, Azion, KeyCDN | | < 1% | Twitter, Vercel, Netlify, OVH CDN, EdgeCast, G-Core CDN, Incapsula | Figure 18.8. Percentage of HTTP/3 `alt-svc` responses for all requests served by first-party CDNs (with considerable traffic share). Firstly, we see that some companies seem to go all-in on HTTP/3, with Facebook for example indicating HTTP/3 support on 99.86% of responses! This is in stark contrast to similar companies like Twitter/X, that don’t send `alt-svc` at all. Secondly, even some CDNs that clearly support HTTP/3 rarely reach high percentages, with Cloudflare leading the pack at 78% and Akamai tagging along at just 7%. This most likely has to do with how exactly the CDNs enable the new protocol. For example, Cloudflare has enabled it by default for their free plans, leading to high (though not universal) use. In contrast, Akamai requires its customers to manually enable the feature in their configuration, which many seem slow/unwilling to do. As such, the amount of HTTP/3 support on the web *could* be much higher than around 28% if all CDN customers would enable it. Finally, it is somewhat surprising that some more specialized deployments, like Automattic, heavily lean into HTTP/3 (99.92%) while others like Vercel and Netlify show near-zero HTTP/3 support. I can only speculate on the reasons for the latter, but assume it is mostly due to the complexity of setting up and maintaining the new protocol at scale, while these newer up-and-coming companies might prefer to focus on other parts of their stacks first. In conclusion, we see that currently around 27% of all websites in the Web Almanac dataset announce HTTP/3 support through `alt-svc`. This number could potentially be much higher, if all websites that use a compatible CDN would enable it. At the same time however, the actual number of HTTP/3 requests we’ve seen in the dataset is much lower, between 7-9%. As we’ve explained, this is due to the used methodology and most of those 7-9% will come from another HTTP/3 discovery method using DNS records, so let’s look at those next. ### HTTP/3 via DNS We now understand that announcing HTTP/3 support via an `alt-svc` HTTP response header has some downsides, leading to the newer protocol only being used from the second connection to a server onwards. To get rid of this inefficiency, the browser would have to discover HTTP/3 support before it even opened the first connection to the server. Luckily, there is still one thing that happens before a connection can be setup and that is: DNS resolution. The Domain Name System (DNS) is often described as a large phone book, which allows you to translate a hostname (for example `www.example.org`) into one or more IP addresses (with `A` and `AAAA` queries returning IPv4 and IPv6 results respectively). However, in essence, the DNS can also be thought of as just a very large, distributed Key-Value store that can hold other things besides IP addresses (and associated metadata like `CNAME`s) as well. Some examples include listing email details with `MX` records, and using `TXT` records to prove ownership of a domain (for example for [Let’s Encrypt](https://letsencrypt.org/docs/challenge-types/#dns-01-challenge)). The past few years, work has been ongoing to also add other information to the DNS, in particular with the new concept of [Service Binding (SVCB) and HTTPS records](https://www.rfc-editor.org/rfc/rfc9460.html#name-goals). These new records provide the client with a lot more information about a service/origin than just its IP addresses: whether it’s HTTPS capable, whether it can use the new [Encrypted Client Hello](https://support.mozilla.org/kb/understand-encrypted-client-hello) for extra privacy, or for our purposes, which protocols it supports and on which ports. This is intended to make initial connection setup/service discovery a bit more efficient, as currently this is often done through slower methods like a chain of redirects or the above `alt-svc`, or requires out-of-band methods like [HSTS preload](https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security). They are also intended to help with complex load balancing setups (for example when combining multiple CDNs). A full discussion on SVCB would take too much time here however, so we will focus only on how we can announce HTTP/3 support through the new HTTPS record as there are [plenty of other](https://www.domaintools.com/resources/blog/the-use-cases-and-benefits-of-svcb-and-https-dns-record-types/) [blog posts](https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns/) and [documents](https://www.isc.org/docs/2022-webinar-dns-scvb.pdf) with [more details](https://www.netmeister.org/blog/https-rrs.html) on the wider applications. Let’s look at an example of the HTTPS record in the wild: Screenshot from the `dig` command line tool showing a DNS HTTPS record listing alpns `h3` and `h2` , and providing both an ipv4hint and ipv6hint for `blog.cloudflare.com` Figure 18.9. DNS HTTPS resource record example. As we can see, `blog.cloudflare.com` indicates support for both HTTP/3 and HTTP/2 (in order of preference!) via the `alpn="h3,h2"` part of the response. ALPN stands for [Application Layer Protocol Negotiation](https://developer.mozilla.org/docs/Glossary/ALPN) which was originally a TLS (Transport Layer Security protocol) extension to indicate which application protocols and versions a server supports. For example, to allow the graceful fallback from HTTP/2 to HTTP/1.1 discussed above. The general approach—and ALPN name—is reused for the DNS HTTPS record as well. Additionally, the example shows the optional `ipv4hint` and `ipv6hint` entries, which allow steering of users to specific endpoints for specific services. For example, if not every single machine in the deployment actually supports HTTP/3 yet, say in a multi-CDN setup. In conclusion, if a browser queries the DNS for the HTTPS records (which is typically done in parallel or even before A and AAAA queries), and subsequently sees `h3` in the ALPN list, then it is allowed/encouraged to also try HTTP/3 for its first connection to the server. This bypasses the `alt-svc` bootstrapping overhead. Let’s now take a look at how much we’ve seen the new DNS records being used in the wild in the Web Almanac dataset. Looking at the general use, we see that around 12% of both mobile and desktop pages have an HTTPS record of some kind defined. Not all of those include the `h3` option in their `alpn` section however: that’s slightly lower at 9% (desktop) and 10% (mobile): Stacked bar chart showing the percentage of home pages that announce HTTP/3 support via a DNS HTTPS record. On Desktop, 9% of pages used a DNS HTTPS record with the `h3` ALPN token set, while 91% used either no DNS HTTPS record at all or one without the `h3` ALPN token set. On mobile, 10% of pages used an HTTP/3-capable DNS HTTPS record. Figure 18.10. HTTP/3 support is regularly being announced through DNS HTTPS records This means that 9-10% (or over 20 million) of all considered pages in our dataset indicate HTTP/3 support through DNS. However, this does not automatically mean that HTTP/3 is also actually used by the browser. As we showed in the first image of this chapter, only about 7% (desktop) to 9% (mobile) of pages were actually loaded over HTTP/3. This is definitely in the same order of magnitude as the DNS HTTPS adoption, but not quite the same. This can have many different reasons, including: networks blocking the newer protocol, HTTP/3 somehow losing the “race” to a HTTP/2 connection (we’ll discuss this in the next section, Other considerations), the DNS HTTPS record being misconfigured, the DNS response for the record being delayed, the HTTP/2 connection being reused due to [connection coalescing](https://blog.cloudflare.com/connection-coalescing-with-origin-frames-fewer-dns-queries-fewer-connections/). Still, it shows that this newer/alternative method of indicating HTTP/3 support early in the page loading process has strong potential to improve upon the `alt-svc` approach! This is especially true for our Web Almanac methodology, as we confirmed that 99% of all page loads observed over HTTP/3 were indeed triggered by the presence of DNS HTTPS records (the 1% discrepancy is a bit weird though, and a good topic for future analysis). It is also interesting to compare this to [similar research done by Jan Schaumann in October 2023](https://www.netmeister.org/blog/https-rrs.html#current-use), who found that for over 100 million tested domains, only about 4% provided HTTPS records, which increased to a whopping 25%+ for the top 1 million domains on the Tranco list. He [concluded](https://www.netmeister.org/blog/https-rrs.html#iphints) that DNS HTTPS record adoption is “effectively driven by Cloudflare setting the records by default on all of their domains”. This would be in-line with our previous findings that it is the big CDNs that drive new feature adoption, so let’s see what our data says: | `h3` DNS records | CDN | | --- | --- | | > 60% | None (yet!) | | 50% - 60% | Cloudflare | | 2% - 50% | BunnyCDN, Alibaba | | < 2% | Akamai, Amazon Cloudfront, Microsoft Azure, Fastly, Netlify, Google, Incapsula, Azion, Sucuri Firewall, Vercel | | < 0.05% | Automattic, OVH | Figure 18.11. Percentage of DNS HTTPS responses with HTTP/3 support for all home pages served by first-party CDNs (with considerable traffic share) We can indeed see that Cloudflare is clearly the leader of the pack here, setting `h3` in the HTTPS DNS record for over 50% of its hosted sites. Most of the other large CDNs do seem to have some support and are testing the feature, but they rarely get above 2%. An interesting outlier here is Automattic, which had near universal HTTP/3 support via `alt-svc`, but only 0.04% for DNS HTTPS records. Outside this, of the 8.5 million pages not loaded via a CDN, only 0.46% had a DNS HTTPS record configured for HTTP/3 support, again reinforcing our conclusion that (for better or worse) CDNs are the ones driving adoption of cutting edge features at scale. It will be interesting to track the use of DNS HTTPS and SVCB records in the coming years of the Web Almanac to both see how their adoption evolves, and how that will map to actual HTTP/3 use in the dataset. ### Other considerations In practice, there is even more complexity in the protocol selection/connection setup process used by modern browsers. One example is an algorithm called [*Happy Eyeballs*](https://wikipedia.org/wiki/Happy_Eyeballs) (yes, really!), which describes how to test for and choose from several different options. This is used to decide between HTTP/2 and HTTP/3, but also IPv4 and IPv6—for which it was originally invented. This algorithm typically “races” different connections against each other and then picks the “winner” to continue the page load on-which means that we sometimes will still see HTTP/2 even though HTTP/3 is supported, if HTTP/2 wins the race. This data is not yet tracked in our dataset, so we don’t really know how often this happens-though in practice this would also heavily depend on testing location and the network used. Another example is the concept of [*connection coalescing*](https://blog.cloudflare.com/connection-coalescing-with-origin-frames-fewer-dns-queries-fewer-connections/) (which they really should have just called “connection reuse” in my opinion), which says that browsers should prefer to reuse an existing connection instead of opening a new one. In practice, if two domains (`a.com` and `b.com`) share the same TLS certificate, the browser can (and often does) re-use an existing connection to `a.com` to fetch `b.com/main.js`. You can imagine [the headaches this gives](https://youtu.be/Ijtnt5iwKWQ?t=362) if `a.com` has HTTP/3 enabled and `b.com` does not… We did not yet analyze how often this happens in the Web Almanac dataset, but from personal experience debugging problems with this, I can assure you it’s definitely out there! 96% Figure 18.12. The percentage of pages that load resources from `cdn.shopify.com` that see *both* HTTP/2 and HTTP/3 connections to that domain. Finally, browsers don’t always wait for an existing (HTTP/2) connection to be closed before opening a new (HTTP/3) connection; sometimes they try to switch much more agressively, even during an ongoing page load over HTTP/2! This can cause “hybrid” page loads, which makes interpreting Real User Monitoring (RUM) metrics and comparing HTTP/2 to HTTP/3 performance quite challenging. Measuring how often this happens in our dataset is a bit tricky, but we tried to get an idea by seeing how many domains had *both* HTTP/2 and HTTP/3 connections opened for them during individual page loads. We find a high dual-protocol usage especially for third parties, with for example `connect.facebook.com` seeing both HTTP/2 and HTTP/3 in the same page load 34% of the time, and `cdn.shopify.com` even switching in 96% of cases. It’s not always this high though, with `www.facebook.com` interestingly only seeing a switch on 12% of pages it’s used on, and various `wp.com` trackers showing only 1-6% (likely because only a few resources are loaded from these domains and there’s no time/need to switch). One caveat is that these switches are also potentially influenced by other factors, such as needing a new connection for CORS reasons or being used in an iframe. Still, I believe the data shows that those “hybrid” page loads are quite common and should be taken into account, even though it’s yet unclear which exact impact this has/can have on performance metrics like Largest Contentful Paint. All of this just reinforces our story so far that there is a lot going on at the network layer nowadays, which makes everything more difficult, from properly judging real adoption from our dataset, to deploying the protocol yourself without CDN support, to correctly analyzing and debugging results from RUM data. While adoption of these newer features is steadily rising due to support from big deployments, it will probably level out relatively soon, taking a long time for smaller deployments and especially individuals to start using the newer protocols. Just like we still see a considerable amount of HTTP/1.1 out there, I expect HTTP/2 also won’t be going anywhere for quite some time. Now that I’ve probably scared you away from ever looking into the internals of protocols ever again, let’s consider some higher-level features that allow you to nudge their behaviour without having to understand what ALPN or SVCB stand for. ## Higher-level browser APIs As we’ve seen in the first part of this chapter, the adoption of HTTP/2 and HTTP/3 are on the rise, and that’s a good thing (mostly). These new protocols implement a lot of performance and security best practices that have tangible benefits for end users. For developers however, the protocols and their features often remain a black box, as there are very few ways to tune them directly. You basically just tick a box on your CDN or server configuration, and hope the browser and server get it right. However, there are a few higher-level features (such as image lazy loading, `async`/`defer` javascript attributes, Resource Hints, the Fetch Priority API), that allow us to influence what happens on the network to an extent. Even though these are not technically always directly tied to HTTP as a protocol, they can have a major impact on how some protocol features (such as connection establishment and resource multiplexing) are used in practice, so we discuss some of them in this chapter. ### Resource Hints Firstly, there are the “[Resource Hints](https://web.dev/learn/performance/resource-hints)”, a group of directives that can be used to guide the browser in various network-related operations, from setting up (parts of) a network connection, over loading a single resource, to doing fetches of entire pages ahead of time. The main ones are `dns-prefetch`, `preconnect`, `preload`, `prefetch`, and `modulepreload`. There was also a `prerender` option which had a bit of a hard time finding its place in the ecosystem, and that use case now moved mostly to the new [Speculation Rules API](https://developer.chrome.com/docs/web-platform/prerender-pages). Bar chart showing the percentage of pages using Resource Hints for 5 specific hint types. `dns-prefetch` is used on 33% of all mobile pages (32% for desktop), `preconnect` is used on 28% of pages (desktop and mobile), `preload` is used on 19% of pages (desktop and mobile), `prefetch` on 6% and `modulepreload` on 1%. Figure 18.13. Resource Hint usage is quite high in our dataset, especially for dns-prefetch and preconnect. These directives have found an impressive uptake over the years, with over 30% of all pages in our dataset using `dns-prefetch`, 28% utilizing `preconnect` and `preload` closing in on 20%. Personally, I find the high usage of `dns-prefetch` somewhat surprising, as in my opinion you should almost always use `preconnect` instead, as it does more (establishing the full connection including TCP+TLS or QUIC handshakes) with negligent overhead, and is also [very well supported](https://caniuse.com/link-rel-preconnect). Furthermore (though purely anecdotally), I often see developers use both `dns-prefetch` and `preconnect` right after each other for the same domain, which is almost completely useless nowadays, as `preconnect` automatically includes a DNS lookup as well and is well supported as noted. Still, an overall high use of these directives is good for performance, as it helps hide connection setup latency to subdomains or third-party domains that might host important assets, such as images or fonts. Some (at least to me) unexpected yet good news is that very few pages seem to overuse these hints. In general, you should rely on the browser to get things right itself—through features like the [preload scanner](https://web.dev/articles/preload-scanner). You should only use the Resource Hints sparingly for those cases where you know the browser doesn’t have enough information—for example, when the 3rd party domain/resource is not mentioned in the HTML directly but only in a CSS/JS file. And this is exactly what most people have been doing (yay!): even at the 90th percentile, pages will only use 3 `dns-prefetch`, 2 `preconnect` and 2 `preload` directives, which is great! <4% Figure 18.14. The percentage of pages that preload 1 or 2 resources without actually using them. Specifically for `preload`, we also looked at how many resources are preloaded in vain and not actually used on the page. The results were again quite encouraging: less than 4% of desktop pages uselessly preload 1 or 2 resources, and less than 2% have 3 or more unused preloads! Still, even though most pages seem to get it right, it’s always fun to look at some of the worst offenders. There will always be pages which include way too many hints, usually either due to misconfiguration or a misunderstanding of what the features are supposed to do. For example, one page had a whopping 3215 preloads! Looking more closely however, it was clear that they are preloading the exact same image over and over again, most likely due to a misconfiguration of their framework/bug in their code. The second worst offender took it easy with “just” 2583 preloads, all of different versions/subsets of various asian fonts from Google Fonts. Finally, one page preloads an amazing 1259 images, turning them into a “smooth” scrolling background animation; arguably, you could say here preload is actually used in a good way to improve the intended effect, though I wouldn’t recommend it in general! Luckily as well, some of the worst problem cases in our dataset have been fixed since our June 2024 crawl, such as a “Sexy Pirate Poker” site going from 2095 to just 14 preloads (steady as she goes, mateys!). A final silver lining is that no pages had more than 1,000 `dns-prefetch` or `preconnect` directives. The worst ones utilized a measly 590 and 441 domains respectively. In general, Resource Hints remain powerful features that should be used sparingly to great effect, something which most developers seem to understand. Let’s now take a deeper look at `preload` specifically though, as it is one of the more powerful hints that is [widely supported](https://caniuse.com/link-rel-preload), and it can have a large impact on performance, both positively and negatively (if used incorrectly). #### Preload Generally speaking, `preload` should mainly be used to inform the browser of resources that are not linked directly in the main HTML document but that you as a developer know will be important/needed later—such as things loaded dynamically with JS `fetch()` or CSS `@import` and `url()`. Preloading them allows the browser to request them earlier from the server, which may improve performance—but can also degrade it, if you try to preload too much. Good concrete examples include fonts (which are typically loaded via CSS *and* only requested by the browser when it actually needs them to render text), JS submodules or components imported dynamically, and (Largest Contentful Paint, LCP) images that are loaded via CSS or JS (which you probably shouldn’t do in the first place, but sometimes there’s no other option). As we saw above, about 20% of all pages utilize `preload`, and because you have to explicitly indicate which type of resource you’re trying to preload with the `as` attribute, we can get some more information on how exactly sites are using it. Bar chart showing the percentage of pages using `preload` for 5 specific resource types. Fonts are preloaded on 8.6% of all desktop and mobile pages, stylesheets are preloaded on 7.6% of desktop and 7.5% of mobile pages, script preloads are found on 7.6% of desktop and 7.3% of mobile pages, images are preloaded on 3.7% of desktop and 3.8% of mobile pages, and fetch calls are preloaded on 0.2% of both mobile and desktop pages. Figure 18.15. Preload is typically used for fonts, stylesheets and scripts. As expected, fonts are the most popular target for preloads, occurring on about 8.6% of pages. Somewhat unexpected however was the high use of preload for stylesheets and scripts. These *could* conceptually be useful, but that would mean over 7.5% of pages should probably [reduce their critical path depth](https://www.debugbear.com/blog/avoid-chaining-critical-requests), if they need preload to speed that up. In practice people often misuse the feature by preloading resources right before they’re mentioned in the HTML; say by having a `` for `style.css` the line above the `` for the same file, which doesn’t really do anything. A worse problem I’ve seen is that people `preload` their `async` and `defer` JS files, often those that are loaded via a `