Understanding Cloudflare HTTP/2 and HTTP/3 Support

Learn about how Cloudflare supports HTTP/2 and HTTP/3 to speed up your website without requiring changes to your existing codebase.


Overview

HTTP/2 and HTTP/3 accelerate page load and are free for all Cloudflare plans.  HTTP/2 is enabled by default and requires an SSL certificate at Cloudflare’s edge network. Configure HTTP/2 and HTTP/3 via the Cloudflare Network app.  

A browser and web server automatically negotiate the highest protocol available. Thus, HTTP/3 takes precedence over HTTP/2.  Cloudflare only uses HTTP/1.x between the origin web server and Cloudflare.

To determine the protocol used for your connection, enter example.com/cdn-cgi/trace from a web browser or client and replace example.com with your domain name. Several lines of data are returned. If http=h2 appears in the results, the connection occurred over HTTP/2. Other possible values are http=http2+quic/99 for HTTP/3, and http=http/1.x for HTTP/1.x.


HTTP/2

HTTP/2 improves page load times via:

  • Connection multiplexing - Retrieves multiple resources in a single network request. Responses are sent when resources are available to avoid slowing page rendering.
  • HTTP header compression - Compresses headers and simplifies HTTP requests to avoid resending headers.
  • HTTP/2 Server Push - To improve page load speed, Cloudflare provides additional resources for a client to cache without waiting for additional requests.

Note:

  • Not all browsers support HTTP/2 and use HTTP 1.x instead.
  • Connection multiplexing is on a per-domain basis.


HTTP/3

HTTP/3 enables fast, reliable, and secure connections.  HTTP/3 encrypts Internet transport by default using a protocol from Google called QUIC.   Enable HTTP/3 via the Cloudflare Network app.  Use the following methods to experiment with HTTP/3:


Server Push

The Server Push feature allows origin web servers to send resources to the client or web browser without waiting to parse HTML for references to additional assets like images, stylesheets, JavaScript, etc.  Server Push avoids the usual HTTP request and response cycle for every script or stylesheet on a page. Server Push is available for all Cloudflare plans.

Server Push extracts URI references within the rel=preload parameter of the Link header from your origin server. These additional URIs are then provided to the client.  Example Link headers include:

Link: </images/image.png>; rel=preload;

Link: </css/main.css>; rel=preload;

Server Push is limited to 50 assets per page and 100 per connection.


Related resources

Browser support information: 

Not finding what you need?

95% of questions can be answered using the search tool. This is the quickest way to get a response.