Skip to content

Commit b136f2b

Browse files
[Speed] Add API link and example for HTTP2 multiplexing (#20315)
* Adds link and API example * Adds dashboard instructions * Apply suggestions from code review Co-authored-by: marciocloudflare <[email protected]> --------- Co-authored-by: marciocloudflare <[email protected]>
1 parent 8241a05 commit b136f2b

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

src/content/docs/speed/optimization/protocol/http2-to-origin.mdx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: HTTP/2 to Origin
44

55
---
66

7-
import { FeatureTable } from "~/components"
7+
import { FeatureTable, Details, Render } from "~/components"
88

99
A protocol is a set of rules governing the exchange or transmission of data between devices. One of the most important protocols that run on the human-computer interaction layer, where applications can access the network services, is HTTP (Hypertext Transfer Protocol).
1010

@@ -29,7 +29,36 @@ If you wish to disable HTTP/2 to Origin, you can follow these steps:
2929

3030
Cloudflare’s HTTP/2 multiplexing to origin reduces active connections by pooling many requests into fewer TCP connections. If a request arrives and the current connection has not reached the stream limit, Cloudflare reuses the existing connection. If the limit has not been reached, Cloudflare may open additional connections to handle more requests. Because multiplexing reuses fewer TCP connections, the overall number of active connections to your origin will typically be lower, which is often helpful for systems sensitive to connection overhead. During surges (like failovers), Cloudflare scales connections by first using available streams, then opening new ones as needed.
3131

32-
Connection multiplexing is enabled by default on Free, Pro and Business zones and uses up to 100 concurrent streams by default. For Enterprise plans, you can explicitly configure the maximum number of concurrent streams (often called the “multiplexing ratio”) for a zone.
32+
### Configuration
33+
34+
Connection multiplexing is enabled by default on Free, Pro and Business zones and uses up to 100 concurrent streams by default. Enterprise plans can explicitly configure the maximum number of concurrent streams (often called the “multiplexing ratio”) for a zone in the dashboard or via API.
35+
36+
<Details header="Dashboard">
37+
38+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account.
39+
2. Choose the domain that will use HTTP/2 to Origin.
40+
3. Select **Speed > Optimization**.
41+
4. Open the **Protocol Optimization** tab.
42+
5. Under **HTTP/2 to Origin**, select **Configure** and adjust the stream settings as needed.
43+
44+
</Details>
45+
46+
<Details header="API">
47+
48+
```bash
49+
curl --request PATCH \
50+
https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/settings/origin_h2_max_streams \
51+
--header 'Content-Type: application/json' \
52+
--header "X-Auth-Email: <CLOUDFLARE_EMAIL>" \
53+
--header "X-Auth-Key: <CLOUDFLARE_API_KEY>" \
54+
--data '{
55+
"value": <int>
56+
}'
57+
```
58+
59+
Refer to the [API documentation](/api/python/resources/zones/subresources/settings/methods/edit/) for more information.
60+
61+
</Details>
3362

3463
:::note
3564
If your origin does not support multiplexing, enabling HTTP/2 to origin may result in 5xx errors, particularly 520s.

0 commit comments

Comments
 (0)