Skip to main content
Beta: Front-End Checklist is currently in beta. Some issues are still being fixed. Thanks for your patience.

Enable HTTP/2 or HTTP/3

Use modern HTTP protocols to enable request multiplexing and reduce network latency.

Utilities
Quick take
Typical fix time 15 min
  • Enable HTTP/2 or HTTP/3 for request multiplexing
  • Eliminate the need for resource concatenation
  • Reduce overhead with header compression
Why it matters: Modern HTTP protocols significantly reduce the impact of latency and allow multiple resources to be downloaded simultaneously over a single connection, leading to much faster page loads.

Rule Details

HTTP/2 and HTTP/3 are major revisions of the HTTP network protocol used by the World Wide Web. They address many of the performance limitations of HTTP/1.1.

Code Example

1. Enabling HTTP/2 in Nginx

Ensure you have an SSL certificate configured, as HTTP/2 requires HTTPS in almost all browsers.

server {
    listen 443 ssl http2;
    server_name example.com;
 
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;
 
    # ... other configuration
}

2. Verifying Protocol in the Browser

You can check which protocol is being used in the Chrome DevTools Network tab.

  1. Open DevTools > Network.
  2. Right-click the table header and check Protocol.
  3. Look for h2 (HTTP/2) or h3 (HTTP/3).

Why It Matters

  • Multiplexing: Allows multiple requests and responses to be sent at the same time over a single TCP connection, preventing "head-of-line blocking."
  • Header Compression: Reduces the size of HTTP headers using HPACK (HTTP/2) or QPACK (HTTP/3), saving bandwidth.
  • Server Push: Allows the server to send resources to the client before they are requested (though this is less commonly used today).
  • Reduced Latency: HTTP/3, built on QUIC, further reduces latency by improving connection establishment and handling packet loss more efficiently.

Best Practices

Confirm the protocol in a real browser trace or PageSpeed Insights (opens in new tab), because the practical benefit comes from how the live edge actually negotiates the connection, not just from a server config line.

Use HTTPS: HTTP/2 and HTTP/3 are only supported over secure connections in browsers. ✅ Stop Concatenating Files: With HTTP/2, small individual files are often more efficient than one giant concatenated bundle because of better caching. ✅ Leverage a CDN: Most modern CDNs (Cloudflare, Akamai, etc.) enable HTTP/2 and HTTP/3 by default. ✅ Prioritize Critical Assets: Use resource hints like preload and preconnect to help the browser prioritize the right streams.

Don't Use Domain Sharding: Splitting assets across multiple domains (e.g., static1.example.com, static2.example.com) is an anti-pattern in HTTP/2 as it breaks multiplexing. ❌ Avoid Excessive Small Files: While concatenation is less necessary, having thousands of tiny files still introduces some overhead.

Tools & Validation

Standards

  • Use web.dev: Learn Performance as the standard for measuring the final production behavior, not just local synthetic output.
  • Use Chrome Developers: Lighthouse overview as the standard for measuring the final production behavior, not just local synthetic output.

Support Notes

  • Verify protocol support end to end on the real CDN, edge, or load balancer path because local origin support does not guarantee production support.
  • Some browser and intermediary combinations may downgrade to HTTP/1.1 silently, so check the effective protocol in target browsers and not only in server config.

Verification

Automated Checks

  • Measure the affected page or flow in Lighthouse, PageSpeed Insights, or DevTools and confirm the targeted metric improves.
  • Inspect the network waterfall or performance timeline to confirm the intended resource or execution change actually took effect.

Manual Checks

  • Verify the change on a throttled mobile profile, not just local desktop.
  • If this rule maps to a budget or Web Vital, confirm the page now stays within that threshold.

Use with AI

Copy these prompts to use with your AI assistant, or install the MCP server to use directly from Claude, Cursor, or Windsurf.

Check

Verify implementation

Verify that the server is serving resources over HTTP/2 or HTTP/3 using browser DevTools or online checkers.

Fix

Auto-fix issues

Enable HTTP/2 or HTTP/3 in your web server (Nginx, Apache) or via a CDN/load balancer.

Explain

Learn more

Explain the advantages of HTTP/2 and HTTP/3 over HTTP/1.1, such as multiplexing and header compression.

Review

Code review

Review the routes, assets, and loading behavior that affect Enable HTTP/2 or HTTP/3. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.

Sources

References used to support the guidance in this rule.

Further Reading

Tools and supplementary material for exploring the topic in more depth.

PageSpeed Insights
pagespeed.web.devTool

Rules that often go hand-in-hand with this one.

Minimize critical request chains

Reduce the number and depth of dependent resource requests that block the initial rendering of the page.

Performance
Optimize web font loading

Use efficient font formats and loading strategies to prevent layout shifts and invisible text.

Performance
Avoid JavaScript-based redirects

Detects JavaScript resources that return 3XX redirects to reduce latency

Performance
Avoid serving legacy JavaScript to modern browsers

Detects ES5 polyfills and legacy JavaScript code to reduce bundle size and improve execution

Performance

Was this rule helpful?

Your feedback helps improve rule quality. This stays internal for now.

Loading feedback...
0 / 385