Skip to main content

HTTP/2

Learning Focus

By the end of this lesson you will understand what HTTP/2 improves over HTTP/1.1, how to enable it in OpenLiteSpeed, and how to verify it is active.

What HTTP/2 Improves

FeatureHTTP/1.1HTTP/2
Requests per connectionOne at a timeMultiplexed (many simultaneously)
Header handlingText, repeated per requestBinary, compressed (HPACK)
Server pushNot availableServer can push assets proactively
Requires HTTPSNoPractically yes (browsers require it)

Enabling HTTP/2

HTTP/2 is enabled at the SSL listener level in OpenLiteSpeed:

  1. Navigate to Listeners → SSL listener → SSL tab
  2. Set Enable HTTP/2 to Yes
  3. Save and Graceful Restart
info

HTTP/2 only works over HTTPS. If you do not have an SSL listener configured, set that up first.

Verifying HTTP/2

# Check protocol negotiation
curl -sI --http2 https://example.com | head -1
# Expected: HTTP/2 200

# Or use openssl
openssl s_client -connect localhost:443 -servername example.com -alpn h2 < /dev/null 2>/dev/null | grep "ALPN"
# Expected: ALPN protocol: h2

Key Takeaways

  • HTTP/2 multiplexes requests over a single connection — no more head-of-line blocking.
  • It is a strong default for most HTTPS sites — enable it on all SSL listeners.
  • Verify with curl --http2 or openssl ALPN negotiation.

What's Next