HTTP/2
Background
HTTP/2 is a next-generation hypertext transfer protocol. It reduces the TCP handshake delay, reduces the packet header transmission volume, and improves transmission efficiency. Addresses starting with http:// can use only the HTTP/1.x protocol, and those starting with https:// support HTTP/2.
Scenarios
HTTP/2 works best in high-concurrency scenarios of small files. It uses TCP multiplexing to reduce the average processing latency of each request (except the first request, skipping repeated TCP and SSL handshakes). In poor networks, HTTP/2 suffers from TCP-level head-of-line blocking. It relies on a single TCP connection for all requests, which demands ordered packet delivery. If one TCP packet is lost, the entire TCP connection is blocked, and all concurrent HTTP/2 streams need to wait until the retransmission completes. Unlike HTTP/2, HTTP/1.1 lets browsers open several TCP connections, so losing one packet does not block other connections.
Scenarios where HTTP/2 is recommended: high-concurrency scenarios of small files and API calling.
Scenarios where HTTP/2 is not recommended: mixed loading of large and small files. If a packet is lost during the transmission of a large file, the loading of small files is slowed down, affecting the first screen performance.
Prerequisites
An HTTPS certificate has been configured. For details, see Configuring an HTTPS Certificate.
Precautions
- Disabling the HTTPS certificate will disable HTTP/2.
- After configuring the HTTPS certificate, wait about 5 minutes for the configuration to complete and then enable HTTP/2.
Protocol Advantages
HTTP/1.1 is the current mainstream protocol used on the Internet. HTTP/2 outperforms HTTP/1.1 and keeps the syntax of HTTP/1.1.
HTTP/2 outperforms HTTP/1.1 in the following aspects:
- Binary framing
HTTP/2 uses binary format to transfer data, while HTTP/1.1 is a text-based protocol. Binary format is more advantageous in resolving and optimizing the protocol, and it raises the efficiency of data transfer.
- Header field compression
HTTP/2 compresses and transfers message headers using HPACK. These headers are traced and stored in a header table. Once a message header has been sent for once, it is cached and can be obtained by other identical message headers automatically.
Requests using HTTP/1.1 carry a large amount of redundant header information, which causes waste to bandwidth. With header field compression, HTTP/2 saves the bandwidth and traffic.
- Multiplexing
HTTP/2 multiplexes multiple requests or responses over a single TCP connection. While HTTP/1.1 establishes a TCP connection for each request or response in order. By sending requests concurrently, HTTP/2 lessens the pressure on server connection and alleviates the network blocking problem.
Procedure
- Log in to the CDN console.
- In the navigation pane, choose .
- In the domain list, click the target domain name or click Configure in the Operation column.
- Click the HTTPS Settings tab.
- Switch on HTTP/2.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.