What is HTTP/2
HTTP/2 is the second major version of the HTTP protocol, standardized in 2015 (RFC 7540). It was developed based on Google's SPDY protocol and addresses the main performance issues of HTTP/1.1.
Key differences from HTTP/1.1:
- Binary protocol instead of text-based
- Multiplexing requests over a single connection
- Header compression (HPACK)
- Server Push (sending resources without a request)
- Request prioritization
HTTP/2 is supported by all modern browsers and most servers (Nginx, Apache, Caddy). According to W3Techs, in 2026, more than 55% of websites use HTTP/2.
Why HTTP/2 is needed
The problem with HTTP/1.1
With HTTP/1.1, each resource (CSS, JS, image) required a separate TCP connection or had to wait in a queue. Browsers opened 6 parallel connections, but with 100+ resources, this created a bottleneck.
What HTTP/2 offers
Multiplexing: all resources are transferred in parallel over a single TCP connection, without queues.
Header compression: repeated headers (Cookie, User-Agent) are compressed using the HPACK algorithm, reducing header size by up to 70%.
Server Push: the server sends CSS and JS before the browser requests them, speeding up the initial page load.
Prioritization: critical resources (CSS) load before non-critical ones (analytics).
Result: pages load 15-50% faster than with HTTP/1.1 under the same conditions.
How to enable HTTP/2
Nginx
server {
listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/ssl/example.crt;
ssl_certificate_key /etc/ssl/example.key;
# Оптимизация для HTTP/2
http2_push_preload on;
}Apache
# В httpd.conf или .htaccess
Protocols h2 h2c http/1.1The mod_http2 module is required. Make sure SSL is configured—browsers support HTTP/2 only over HTTPS.
Check with curl
curl -I --http2 https://example.com
# Ищите: HTTP/2 200 в ответеHTTP/3 and QUIC
In 2022, HTTP/3 was standardized (RFC 9114), running over the QUIC protocol (UDP instead of TCP). Benefits:
- No transport-layer head-of-line blocking
- Fast recovery after packet loss
- 0-RTT connection on repeat visits
HTTP/3 is supported by ~30% of websites. Nginx added support in version 1.25.
Check HTTP/2 with reChecker
Use HTTP/2 & Brotli to check your website's protocol. The tool shows:
- The HTTP protocol version (HTTP/1.1, HTTP/2, HTTP/3)
- Brotli and Gzip compression support
- Whether Server Push is available
- ALPN protocol negotiation
FAQ
Does HTTP/2 work without SSL? Technically, the protocol allows HTTP/2 without encryption (h2c). However, all modern browsers require HTTPS for HTTP/2. In practice: if you want HTTP/2, you need SSL.
Does HTTP/2 automatically speed up a website? Not always. HTTP/2 provides the greatest benefit when a site has many small resources. For sites with optimized HTTP/1.1 (concatenation, sprites), the benefit may be minimal.
Should files still be combined when using HTTP/2? Concatenating JS/CSS files and using CSS sprites became unnecessary with HTTP/2: multiplexing transfers many small files more efficiently. However, large bundles are still worse for caching.