Get help 24/7
Cloudflare HTTP/2 progressively enhances your website’s performance. When a browser supports HTTP/2, our edge network will take full advantage of HTTP/2 performance benefits. If the browser supports SPDY but not HTTP/2, we’ll respond in SPDY. For older browsers or non-HTTPS requests, we’ll fall back to HTTP/1.1. You don’t need to choose between better performance and backwards-compatibility.
HTTP/2 is automatically enabled for all Free and Pro accounts and can be turned on with a single click for Business and Enterprise customers. It requires no changes to your web server configuration.Sign up now View a live demo
HTTP/2 is the first upgrade to the Hypertext Transfer Protocol since 1999. It’s goal is to improve website performance by optimizing how HTTP is expressed “on-the-wire.” It doesn’t change the semantics of HTTP, which means header fields, status codes, and cookies work exactly the same way as in HTTP/1.1.
HTTP/2 began its life as Google’s SPDY protocol, which they designed to address many of the performance problems inherent in HTTP/1.1. The core benefits of SPDY have made their way into HTTP/2, improved by the global Internet community, and formalized into an Internet Standard.
HTTP/2 introduces several new features, and they’re all designed to improve page load times for your website visitors.
Multiplexing is perhaps the most significant benefit of HTTP/2. HTTP/1.1 requires each request to use its own TCP connection. Multiplexing, in contrast, allows a browser to include multiple requests in a single TCP connection.
The problem is, a browser can only have a limited number of TCP connections open at any given time. For HTTP/1.1, this means a browser can only load a single resource at a time—every asset in a web page is sent back to the browser sequentially. Multiplexing allows a browser to request all these assets in parallel. This results in a dramatic performance gain.
HTTP/1.1 is sort of like buying a single item at a grocery store, taking it back home, going back to the store for the next item you need, and repeating until your pantry is fully stocked. Multiplexing gives you a shopping cart so you can pick up everything you need in one trip.
HTTP/2 forces all HTTP headers to be sent in a compressed format, reducing the amount of information that needs to be exchanged between browser and server. HTTP/1.1 does not provide any form of header compression.
HTTP/2 Server Push lets our edge network send web assets back to your browser before it even knows it needs them. This speeds up page load times by eliminating unnecessary round trips. For example, when a browser requests an HTML page, you can “push” all of the CSS stylesheets, image resources, and other assets inside of that web page. After the browser parses the HTML and finds all those assets, they’ll already be loaded into the local browser cache. This avoids extra requests back to the server.
See more details about HTTP/2 Server Push.
You can think of stream priority as an optimization on top of multiplexing. Multiplexing lets you send several requests in a single TCP connection, and stream priority lets you define the order of the responses. While multiplexing eliminates much of the TCP overhead, it does nothing to optimize transfer times from the server to the browser. This is what stream priority is for.
You can serve your existing applications over HTTP/2 without any changes to the underlying code, but to take full advantage of all HTTP/2 has to offer, make sure you understand the impact that HTTP/2 will have on your website.
Concatenating files is no longer a best practice in HTTP/2. While concatenation can still improve compression ratios, it forces expensive cache invalidations. Even if only a single line of CSS is changed, browsers are forced to reload all of the assets. In HTTP/2, it’s better to ship granular resources and optimize how they’re cached.
Domain sharding should be avoided in HTTP/2. The goal of sharding is to maximize the amount of active TCP connections. However, each of these connections incur unnecessary overhead and compete with each other for bandwidth. Eliminating domain sharding also makes for simpler build and deployment processes, since all your assets can now live on a single server.
These are just a few optimizations to consideration when deciding if HTTP/2 is right for you.
HTTP/2 does not technically require an encrypted connection, but the majority of implementations only support HTTP/2 when used in conjunction with SSL/TLS. No browsers currently support HTTP/2 over an unencrypted connection. For practical purposes, this means that your website must be served over HTTPS to take advantage of HTTP/2.
If you’re not already serving your website over HTTPS, you can enable it for free with our Universal SSL offering.
HTTP/2 is available free of charge to all Cloudflare customers. HTTP/2 is automatically enabled for both Free and Pro accounts, and can be enabled with the click of a button for Business and Enterprise accounts.
Set up a domain in less than 5 minutes. Keep your hosting provider. No code changes required.
Everyone’s Internet application can benefit from using Cloudflare.
Pick a plan that fits your needs.