Skip to content
AnswerWell geo Documentation

Research · 7 min read · Answerwell

HTTP/2 Origin Multiplexing, Keep-Alive, and Protocol Optimization

How HTTP/2 and HTTP/3 work behind a reverse proxy: edge settings, origin multiplexing limits, keep-alive timeouts, and when to tune or troubleshoot.

This page summarizes Cloudflare documentation on protocol optimization: HTTP/2 and HTTP/3 between visitors and the edge, HTTP/2 to Origin with configurable multiplexing on Enterprise plans, connection reuse and idle limits, and common failure modes. When traffic is proxied, there are typically two TCP paths—client to Cloudflare and Cloudflare to your origin—each with its own HTTP version choices and timeouts (connection limits).

HTTP/2 and HTTP/3 at the edge: what visitors use

Section titled “HTTP/2 and HTTP/3 at the edge: what visitors use”

HTTP/2 at Cloudflare’s edge uses TCP and TLS and is aimed at faster page loads (HTTP/2). Google describes the version similarly as more efficient than HTTP/1.1 for browsers and servers (What is HTTP/2).

HTTP/2 is enabled by default for all plans (though it does require an SSL certificate at Cloudflare’s edge network).

— Cloudflare, HTTP/2

HTTP/3 uses QUIC over UDP, can improve performance on lossy networks, and is also edge-only today—HTTP/3 connection to the origin is not yet supported (HTTP/3 (with QUIC)). For proxied zones with Universal SSL, Cloudflare can advertise how clients should connect via generated HTTPS DNS records (proxy status).

Setting Default / availability Notes
HTTP/2 (visitor → edge) On by default; needs SSL at edge Free plans cannot disable HTTP/2 in dashboard
HTTP/3 (visitor → edge) Available on all plans; needs SSL at edge Toggle under Speed → Protocol Optimization
HTTP/3 to origin Not supported Use HTTP/2 or HTTP/1.1 to origin

Chrome’s performance tooling treats modern protocols as a quality signal: Lighthouse expects resources over HTTP/2 (uses-http2); the Modern HTTP insight flags sites still serving many assets over HTTP/1.1 when HTTP/2 or HTTP/3 would help (Modern HTTP).

How to turn edge HTTP/2 or HTTP/3 on or off

Section titled “How to turn edge HTTP/2 or HTTP/3 on or off”

For HTTP/3, use the dashboard (Speed → Settings → Protocol Optimization) or API PATCH with setting http3 and value "on" (HTTP/3 (with QUIC)). To disable visitor-side HTTP/2 on paid plans, the same area exposes an HTTP/2 toggle, or API http2 set to "off" (HTTP/2).

HTTP/2 to Origin: multiplexing and stream limits

Section titled “HTTP/2 to Origin: multiplexing and stream limits”

HTTP/2 to Origin is the link from Cloudflare’s network to your server. Multiplexing puts many requests on one long-lived TCP connection instead of opening one connection per request (HTTP/2 to Origin).

Cloudflare supports HTTP/2 multiplexing from its global edge network to your origin servers. Instead of opening a new TCP connection for every incoming request, multiple HTTP/2 streams share a single long-lived TCP connection.

— Cloudflare, HTTP/2 to Origin

When a request arrives, Cloudflare reuses an existing origin HTTP/2 connection if the concurrent stream limit is not reached; otherwise it opens another connection. Connections stay up until idle or concurrency limits apply. If the origin does not speak HTTP/2, Cloudflare falls back to HTTP/1.1 via ALPN.

Enterprise customers gained configurable origin multiplexing in 2025 (cache changelog):

You can now configure HTTP/2 multiplexing settings for origin connections on Enterprise plans. This feature allows you to optimize how Cloudflare manages concurrent requests over HTTP/2 connections to your origin servers, improving cache efficiency and reducing connection overhead.

— Cloudflare, Configurable multiplexing HTTP/2 to Origin

Plan defaults: who can tune origin stream count

Section titled “Plan defaults: who can tune origin stream count”
Plan HTTP/2 to origin Max concurrent streams (typical) Configurable multiplexing
Free / Pro / Business Enabled by default Up to 200; default use ~100 No
Enterprise Enabled; multiplexing effectively starts conservative 1–200+ per zone Yes (dashboard or API)

On Enterprise, documentation notes multiplexing may start with 1 stream per connection until you raise the limit (HTTP/2 to Origin). During the HTTP/2 handshake Cloudflare reads the origin’s SETTINGS_MAX_CONCURRENT_STREAMS and honors the lower of origin and zone settings—so the origin can cap parallelism even when Cloudflare allows more.

If the origin does not support multiplexing, enabling HTTP/2 to origin may produce 5xx errors, especially 520 (HTTP/2 to Origin). You can disable HTTP/2 to Origin under Speed → Protocol Optimization (HTTP/2 to Origin).

How to set origin origin_h2_max_streams (Enterprise)

Section titled “How to set origin origin_h2_max_streams (Enterprise)”
  1. In the Cloudflare dashboard, open Speed → Optimization → Protocol Optimization → HTTP/2 to Origin → Configure.
  2. Adjust maximum concurrent streams for the zone (the “multiplexing ratio”).
  3. Or call the Zone Settings API with PATCH on origin_h2_max_streams (example below).
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/settings/origin_h2_max_streams" \
--request PATCH \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"value": 100
}'

Permissions needed: Zone Settings Write or Zone Write (HTTP/2 to Origin). Increase limits gradually if the backend is sensitive to parallel requests; Cache Locking can reduce parallel origin hits during revalidation (same page).

Cloudflare Tunnel (cloudflared) is separate: origin parameter http2Origin defaults to false (HTTP/1.1 to origin); set it true only for HTTPS origins that support HTTP/2 (origin parameters).

Keep-alive and connection lifecycle: client vs origin

Section titled “Keep-alive and connection lifecycle: client vs origin”

Connection reuse (persistent connections) sends multiple HTTP requests on one TCP connection and avoids repeated handshakes (connection reuse). HTTP/1.1 made that the default; HTTP/2 extends reuse with streams and, for browsers, connection coalescing when hostnames share IP, port, and certificate SANs (same doc).

Between client and Cloudflare, idle HTTP/2 connections close after 400 seconds (not customer-configurable) (connection limits). Cloudflare also overwrites incoming Connection to Keep-Alive for HTTP/1.x semantics at the edge (HTTP headers).

Between Cloudflare and origin, keep-alive reuse is encouraged; idle origin connections are closed after 900 seconds without active streams, and reuse of a closed connection can yield a 520 (HTTP/2 to Origin, load balancers). TCP keep-alives probe unresponsive origins (first probe after ~30s idle, second after 15s); two unanswered probes reset the link (HTTP/2 to Origin).

Connections may also end because of load balancing, maintenance, max concurrency, or the origin closing idle sockets—there is no prewarmed idle pool; connections are created on demand (HTTP/2 to Origin).

When an origin sends HTTP/2 GOAWAY, Cloudflare stops new requests on that connection but does not mark the endpoint unhealthy; safe-to-retry GET requests retry on a new connection, while POST/PUT may not retry if already sent (adaptive routing). Troubleshooting notes tie unexpected GOAWAY(0) to restarts or refused streams and point to SETTINGS_MAX_CONCURRENT_STREAMS (protocol troubleshooting).

For 100 Continue, Cloudflare’s keep-alive model usually makes the response unnecessary (1xx informational).

Enhanced HTTP/2 Prioritization: faster loads, Safari caveats

Section titled “Enhanced HTTP/2 Prioritization: faster loads, Safari caveats”

Enhanced HTTP/2 Prioritization changes delivery order at the edge instead of following each browser’s default HTTP/2 scheduling—largest gains are often on Safari and Edge (Enhanced HTTP/2 Prioritization).

With Enhanced HTTP/2 Prioritization, Cloudflare overrides the default browser behavior to optimize the order of resource delivery, independent of the browser.

— Cloudflare, Enhanced HTTP/2 Prioritization

Enable it under Speed → Protocol Optimization, or API setting h2_prioritization "on" (same doc). If Safari on macOS or any browser on iOS shows broken images or slow loads, disable Enhanced HTTP/2 Prioritization; documentation also says disabling HTTP/2 may be needed if the feature re-enables automatically (iOS/Safari troubleshooting).

Protocol errors: HTTP/2 origin, HTTP/3 in Chrome, SSL

Section titled “Protocol errors: HTTP/2 origin, HTTP/3 in Chrome, SSL”

Visitor-side ERR_HTTP2_PROTOCOL_ERROR often traces to origin misconfiguration that appears only when proxied (HTTP/2).

HTTP/3-specific pain includes intermittent SSL protocol errors when UDP/QUIC is blocked (ERR SSL PROTOCOL ERROR). For stalls only in Chrome over HTTP/3, Cloudflare documents a known Chrome QUIC issue: symptoms include ERR_QUIC_PROTOCOL_ERROR, large download stalls, and relief when HTTP/3 is off or QUIC is disabled in chrome://flags (protocol troubleshooting). Workarounds include disabling HTTP/3 for the zone, removing Alt-Svc via a Response Header Transform Rule for a hostname, or waiting out up to 24 hours of cached alternative-service hints (same doc).

Common mistakes:

  • Enabling origin multiplexing on a server that does not implement HTTP/2 streams correctly (520s, stream resets).
  • Setting Enterprise stream limits above what the origin CPU can handle.
  • Leaving Enhanced HTTP/2 Prioritization on while debugging iOS/Safari rendering issues.
  • Assuming HTTP/3 applies to origin fetches—it does not (HTTP/3 (with QUIC)).
  1. Confirm visitor protocols: ensure the zone uses HTTPS at the edge, then verify HTTP/2 and optionally HTTP/3 under Protocol optimization (Speed → Protocol Optimization).
  2. Check origin HTTP/2 support and negotiated limits using your origin docs or an HTTP/2 test tool such as h2spec (linked from Cloudflare’s HTTP/2 to Origin page).
  3. Compare behavior with HTTP/3 temporarily off if Chrome shows QUIC-related errors (Troubleshoot protocol issues).
  4. On Enterprise, after changing origin_h2_max_streams, watch origin latency and 5xx rates during traffic spikes (HTTP/2 to Origin).
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page does not match your setup or the official docs, write to yimasynthetic@gmail.com with the page URL and the exact sentence you are questioning so it can be corrected or clarified.