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
| Feature | HTTP/1.1 | HTTP/2 |
|---|---|---|
| Requests per connection | One at a time | Multiplexed (many simultaneously) |
| Header handling | Text, repeated per request | Binary, compressed (HPACK) |
| Server push | Not available | Server can push assets proactively |
| Requires HTTPS | No | Practically yes (browsers require it) |
Enabling HTTP/2
HTTP/2 is enabled at the SSL listener level in OpenLiteSpeed:
- Navigate to Listeners → SSL listener → SSL tab
- Set Enable HTTP/2 to
Yes - 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 --http2oropensslALPN negotiation.
What's Next
- Continue to HTTP/3 (QUIC) for the next-generation protocol.