How do I know if my website is being served over HTTP or HTTP/2?

Vadim picture Vadim · Apr 29, 2016 · Viewed 17.2k times · Source

Is there a command or a service that will tell me whether my websites are being served over HTTP or HTTP/2.

I found this tool: HTTP/2 Test | A simple HTTP/2.0 test tool, but it only tells me whether my website supports HTTP/2, but not whether it is already using HTTP/2.

These is also this Chrome Extension: HTTP/2 and SPDY indicator, which tells me that HTTP/2 is already enabled on my site, but as far as I know my version of Apache doesn't even support it.

Is there any way to know for sure? Thanks!

Answer

Rob picture Rob · Apr 29, 2016

Apache doesn't have to support it. The Chrome extension reads the HTTP headers to determine that.

Another method is simply to look at the network tab > headers > response headers > view source in Chrome or Firefox. There the headers can be seen. It should read "HTTP/2" or some sort I can't recall right now.

Easiest: You can use curl -I <your site> which will put the HTTP response as the first line.

HTTP/2.0 200
server:nginx
date:Fri, 29 Apr 2016 14:31:40 GMT
content-type:text/html; charset=utf-8
content-length:7629
last-modified:Thu, 07 Apr 2016 02:41:08 GMT
....