Skip to main content

HTTP/3 and QUIC on Linux VPS: Slashing Mobile Latency, Boosting TTFB, and Core Web Vitals

HTTP/3 replaces TCP with QUIC over UDP, eliminating head-of-line blocking on lossy mobile connections. Here is how to configure HTTP/3 in Nginx, tune Linux UDP buffers, and cut mobile TTFB for better Core Web Vitals.

Cover image for HTTP/3 and QUIC on Linux VPS: Slashing Mobile Latency, Boosting TTFB, and Core Web Vitals

Over 80 percent of web visits in India come from smartphones on 4G and 5G networks. When signals fluctuate or packets drop in busy city areas, HTTP/2 over TCP causes connection stalls. HTTP/3 and QUIC over UDP remove these bottlenecks. The result is faster page loads and lower Time to First Byte (TTFB).

CDNs have offered HTTP/3 at their edges for years. But terminating QUIC directly on your origin server gives bigger gains for dynamic APIs, authenticated pages, and self-hosted platforms. Modern Nginx now supports HTTP/3 natively. Setting it up on your own Linux server is simple and production-ready.

How HTTP/3 and QUIC fix TCP head-of-line blocking

HTTP/2 lets browsers request many assets (HTML, CSS, images) over one TCP connection. This solved the old HTTP/1.1 queue problem. But TCP enforces strict byte ordering. If one packet drops, the whole stream pauses.

QUIC is the transport protocol inside HTTP/3. It runs over UDP instead of TCP. Each asset downloads in its own stream. If one stream stalls, the others keep going.

When a packet drops on Stream A, the client tells the server right away. The server resends only that packet. Streams B, C, and D continue without interruption. On cellular networks with 2 to 4 percent packet loss, HTTP/3 delivers pages 25 to 40 percent faster than HTTP/2.

HTTP versions at a glance

Feature HTTP/1.1 HTTP/2 HTTP/3
Transport TCP TCP UDP (via QUIC)
Parallel downloads 6 TCP connections per host 1 connection, many streams 1 UDP session, independent streams
Head-of-line blocking Yes (application layer) Yes (TCP layer) No (each stream is independent)
First handshake 2–3 round trips 2 round trips 1 round trip; 0-RTT for returning visitors
Mobile network impact Moderate High stalls on packet loss Minimal; isolated stream recovery
Connection survives IP change No No Yes (via 64-bit Connection ID)

Connection migration: staying online when phones switch networks

A TCP connection binds to the four values that identify it: your IP, your port, the server IP, and the server port. When your phone leaves WiFi and connects to 5G, your IP changes. The TCP connection breaks. The browser must close all active requests, look up DNS again, and complete a new TCP plus TLS handshake before resuming.

QUIC uses a 64-bit Connection ID instead of the IP-address four-tuple. When your phone switches networks, the client sends its Connection ID from the new IP address. The server validates it and keeps the session alive. Active downloads, live API calls, and form submissions continue without interruption. For e-commerce checkouts and SaaS apps, this eliminates the cart drops and broken sessions that plague TCP on mobile.

Does HTTP/3 speed up TTFB and Core Web Vitals?

Yes. The gains are biggest on mobile and for returning visitors.

Time to First Byte (TTFB)

TTFB is the gap between clicking a link and receiving the first byte of the page. On a fresh TCP plus TLS connection, the client must finish three steps before the server can respond. First, DNS lookup (if not cached). Second, a TCP three-way handshake (1 round trip). Third, a TLS 1.3 handshake (1 round trip).

That is at least 3 round trips. On a 60ms mobile connection, those handshakes alone consume 180ms. Your server has not executed a single line of code yet.

QUIC combines transport and cryptography into a single round trip. For returning visitors who cache cryptographic parameters, 0-RTT mode sends the page request inside the very first packet. On slow mobile links, 0-RTT cuts TTFB by 100 to 250ms.

Largest Contentful Paint (LCP)

LCP measures when the largest visible element (a hero image, a banner, a heading) finishes loading. TTFB is the starting line for LCP. A faster server response means the browser starts downloading the hero image sooner. QUIC also puts the LCP image in its own high-priority stream. A dropped packet for an unrelated asset will not block it.

AI search crawler retrieval deadlines

AI engines such as PerplexityBot fetch live URLs under strict time limits. When pages load faster, they return complete HTML before those engines time out and cite a faster competitor instead. See our guide on AI search crawlers and server performance for the full picture.

Does Googlebot use HTTP/3?

Yes. Google confirmed that Googlebot negotiates HTTP/3 over QUIC when servers advertise it via the Alt-Svc header. Switching to UDP lets Googlebot crawl more pages within its crawl budget. It avoids TCP handshake overhead on every request.

Configuring HTTP/3 and QUIC in Nginx

You need Nginx 1.25.0 or newer with the ngx_http_v3_module (included in official mainline packages).

Step 1: Check for HTTP/3 support

nginx -V 2>&1 | grep -o -- '--with-http_v3_module'

If the command prints --with-http_v3_module, you are ready. If it returns blank, upgrade:

sudo apt update
sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
  | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
http://nginx.org/packages/mainline/ubuntu $(lsb_release -cs) nginx" \
  | sudo tee /etc/apt/sources.list.d/nginx.list
sudo apt update
sudo apt install -y nginx

Step 2: Configure the Nginx server block

QUIC runs on UDP port 443. Your existing HTTPS still runs on TCP port 443. Nginx listens on both at the same time.

The first time a browser visits, it uses TCP. The server replies with an Alt-Svc header telling the browser that HTTP/3 is available on UDP port 443. The browser switches to QUIC on the next visit.

Open your site config (for example, /etc/nginx/conf.d/example.com.conf) and add:

server {
    # TCP listeners — HTTP/2 fallback for older clients
    listen 443 ssl;
    listen [::]:443 ssl;

    # UDP listeners — QUIC / HTTP/3
    listen 443 quic reuseport;
    listen [::]:443 quic reuseport;

    server_name example.com www.example.com;

    # TLS certificates (TLS 1.3 required for HTTP/3)
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers off;

    # QUIC-specific settings
    ssl_early_data on;
    quic_retry on;
    quic_gso on;

    # Tell browsers HTTP/3 is available on UDP 443 for the next 24 hours
    add_header Alt-Svc 'h3=":443"; ma=86400' always;

    # Security headers
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Frame-Options "SAMEORIGIN" always;

    root /var/www/example.com/public;
    index index.html index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
        proxy_set_header Early-Data $ssl_early_data;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }
}

Key settings explained

  • listen 443 quic reuseport; — activates the QUIC listener on UDP 443. The reuseport flag lets multiple CPU cores share the UDP socket.
  • add_header Alt-Svc 'h3=":443"; ma=86400' always; — advertises HTTP/3 availability. The ma=86400 tells browsers to remember it for 24 hours. always ensures the header appears on error pages too.
  • quic_gso on; — hands large UDP packets directly to the network card, cutting CPU usage under heavy traffic.
  • ssl_early_data on; — enables 0-RTT for returning visitors.

Tuning Linux UDP buffers for QUIC

TCP has decades of kernel tuning behind it. UDP buffers, by default, are sized for DNS queries and syslog. When QUIC traffic spikes, the default buffers overflow. The kernel drops packets. QUIC retransmits. Latency climbs.

Add these kernel parameters to /etc/sysctl.d/60-quic.conf to handle thousands of concurrent QUIC sessions:

# Allow 16 MB socket buffers
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 4194304
net.core.wmem_default = 4194304

# Queue more packets during traffic bursts
net.core.netdev_max_backlog = 10000

# Use BBR congestion control for better throughput on lossy links
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

Apply without rebooting:

sudo sysctl --system

Verify the settings:

sysctl net.core.rmem_max net.core.wmem_max

Pair this with NVMe SSD storage for Indian hosting to keep disk writes fast when QUIC retransmits or checkpoints data.

Opening UDP port 443

HTTP/3 stops working if UDP 443 is blocked. TCP 443 is open on most servers, but QUIC needs UDP 443 explicitly allowed.

For UFW:

sudo ufw allow 443/udp comment 'HTTP/3 QUIC'
sudo ufw status verbose

For raw iptables:

sudo iptables -A INPUT -p udp --dport 443 -m comment --comment "HTTP/3 QUIC" -j ACCEPT

If you use a cloud provider firewall (security groups, network ACLs), add an inbound UDP 443 rule there too.

Testing your HTTP/3 setup

Browsers only discover QUIC after a TCP visit. A first load showing h2 in DevTools is normal.

Test with curl

curl -I --http3 https://example.com

Look for HTTP/3 200 in the output. Also check the Alt-Svc header over TCP:

curl -I https://example.com | grep -i alt-svc

Test with Chrome DevTools

  1. Open DevTools and go to the Network tab.
  2. Right-click a column header and check Protocol.
  3. Visit your site. First load shows h2.
  4. Refresh without clearing cache. The protocol should show h3 for the main document and static assets.

If you still see h2, check that the Alt-Svc header is present and that UDP 443 is not blocked.

Server CPU and QUIC

QUIC is faster for users but needs more CPU than HTTP/2. TCP benefits from decades of hardware offloading in network chips. QUIC encryption runs in software. Choose servers with modern CPUs that support AES-NI acceleration. Dedicated physical cores help when running hundreds of dynamic QUIC connections. Explore our VPS hosting plans or bare metal servers.

Make sure Linux kernel 4.18 or newer is running so quic_gso on; works. Ensure reuseport is active so traffic distributes across all Nginx worker processes.

Frequently asked questions

Will enabling HTTP/3 break older browsers?

No. Clients that do not support QUIC ignore the Alt-Svc header and stay on HTTP/2 or HTTP/1.1 over TCP. Your server answers both without any disruption.

Why does my browser use HTTP/2 on the first visit?

Browsers cannot probe UDP port 443 without causing delay on every new connection. The first visit always uses TCP. The server replies with Alt-Svc: h3=":443". The browser stores this and switches to QUIC on the next visit.

Does 0-RTT resumption introduce security risks?

Only for state-changing requests such as POST. RFC standards restrict 0-RTT to safe, repeatable requests (GET and HEAD). Nginx passes the ssl_early_data variable to backends so you can block or isolate early-data requests.

Does HTTP/3 need a new SSL certificate?

No. HTTP/3 uses the same TLS certificates you already use for HTTPS. The keys and certificate chain are identical. Only the transport protocol changes from TCP to QUIC.

Written by

Renish Mithani

Hosted in India, written in English

  • 12 min read

Share this post

Need help?

Talk to sales on WhatsApp

Our team replies during Indian business hours. Tell us which plan you're looking at and we'll match you with the right setup.

Cookie Preferences