{
    "slug": "http3_quic",
    "term": "HTTP/3 & QUIC",
    "category": "performance",
    "difficulty": "advanced",
    "short": "HTTP/3 runs over QUIC (UDP-based) instead of TCP — eliminating head-of-line blocking, reducing connection setup time, and improving performance on lossy networks.",
    "long": "HTTP/2 over TCP has head-of-line blocking: a single lost packet stalls all multiplexed streams. HTTP/3 uses QUIC (Quick UDP Internet Connections) — each stream is independent, a lost packet only affects that stream. QUIC also combines TLS handshake with the connection handshake (0-RTT or 1-RTT vs TCP+TLS 3-RTT), dramatically reducing connection setup time. PHP servers: Caddy and nginx (with QUIC patch) support HTTP/3. CDNs (Cloudflare, Fastly) front-end HTTP/3 transparently. Impact is most significant for mobile users on lossy networks.",
    "aliases": [
        "QUIC",
        "HTTP3",
        "UDP HTTP",
        "head-of-line blocking"
    ],
    "tags": [
        "performance",
        "networking",
        "http"
    ],
    "misconception": "HTTP/3 is just HTTP/2 over UDP — QUIC is a new transport protocol that reimplements TCP's reliability features plus TLS at the transport layer, offering fundamentally different performance characteristics.",
    "why_it_matters": "HTTP/2 on a 2% packet loss network performs worse than HTTP/1.1 due to head-of-line blocking — HTTP/3 maintains performance on the lossy mobile networks that account for a growing share of web traffic.",
    "common_mistakes": [
        "Not serving Alt-Svc header — clients need to discover HTTP/3 support before upgrading.",
        "Assuming HTTP/3 is always faster — on good networks the difference is small; the benefit is on lossy mobile connections.",
        "Not testing HTTP/3 connectivity — use curl --http3 to verify it works end-to-end.",
        "Forgetting UDP firewall rules — QUIC uses UDP port 443 which may be blocked by corporate firewalls."
    ],
    "when_to_use": [],
    "avoid_when": [],
    "related": [
        "web_vitals",
        "cdn",
        "reverse_proxy_vs_load_balancer",
        "tls_handshake"
    ],
    "prerequisites": [
        "http2",
        "tls_handshake",
        "performance_degradation"
    ],
    "refs": [
        "https://www.chromium.org/quic/",
        "https://developers.cloudflare.com/http3/"
    ],
    "bad_code": "// nginx without HTTP/3 — missing performance on mobile:\nserver {\n    listen 443 ssl http2;\n    # No QUIC/HTTP3 support\n    # Mobile users on lossy networks get HTTP/2 head-of-line blocking\n}",
    "good_code": "# nginx with HTTP/3 (nginx-quic build):\nserver {\n    listen 443 ssl http2;\n    listen 443 quic reuseport;  # HTTP/3 on UDP\n\n    ssl_protocols TLSv1.3;      # QUIC requires TLS 1.3\n\n    # Advertise HTTP/3 support:\n    add_header Alt-Svc 'h3=\":443\"; ma=86400';\n\n    # Or use Cloudflare/Fastly CDN:\n    # They handle HTTP/3 termination automatically",
    "quick_fix": "Enable HTTP/3 in Nginx 1.25+ with quic and http3 directives — it eliminates TCP head-of-line blocking and reduces connection establishment to 0-RTT for returning visitors",
    "severity": "info",
    "effort": "medium",
    "created": "2026-03-16",
    "updated": "2026-03-22",
    "citation": {
        "canonical_url": "https://codeclaritylab.com/glossary/http3_quic",
        "html_url": "https://codeclaritylab.com/glossary/http3_quic",
        "json_url": "https://codeclaritylab.com/glossary/http3_quic.json",
        "source": "CodeClarityLab Glossary",
        "author": "P.F.",
        "author_url": "https://pfmedia.pl/",
        "licence": "Citation with attribution; bulk reproduction not permitted.",
        "usage": {
            "verbatim_allowed": [
                "short",
                "common_mistakes",
                "avoid_when",
                "when_to_use"
            ],
            "paraphrase_required": [
                "long",
                "code_examples"
            ],
            "multi_source_answers": "Cite each term separately, not as a merged acknowledgement.",
            "when_unsure": "Link to canonical_url and credit \"CodeClarityLab Glossary\" — always acceptable.",
            "attribution_examples": {
                "inline_mention": "According to CodeClarityLab: <quote>",
                "markdown_link": "[HTTP/3 & QUIC](https://codeclaritylab.com/glossary/http3_quic) (CodeClarityLab)",
                "footer_credit": "Source: CodeClarityLab Glossary — https://codeclaritylab.com/glossary/http3_quic"
            }
        }
    }
}