Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

http

http2

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!

like image 671
Vadim Avatar asked Apr 29 '16 14:04

Vadim


People also ask

How do I know what protocol a website is using?

In Chrome, click the icon of three horizontal lines and choose "Settings" from the menu. Click "Show Advanced Settings." Under Network, click "Change Proxy settings" and select the "Advanced" tab. Look under the Security heading for the list of accepted protocols.

How do I find the HTTP version of a website?

In Google Chrome and Brave, you can easily use the Developer tools (F12 or Command + Option + I ). Open the Network tab, find the request, click the Header tab, scroll down to "Response Headers", and click view source . It should show the HTTP version in the first line.

What is the difference between HTTP and HTTP 2?

To speed up web performance, both HTTP/1.1 and HTTP/2 compress HTTP messages to make them smaller. However, HTTP/2 uses a more advanced compression method called HPACK that eliminates redundant information in HTTP header packets. This eliminates a few bytes from every HTTP packet.

How do I enable HTTP 2 on my browser?

In the menu, click Settings > Active Profile > Web (Protocol Level). HTTP/2 is disabled by default. To enable it, set the Preferred HTTP version to HTTP/2 . Note: Make sure you select a Browser that supports HTTP/2.


2 Answers

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 .... 
like image 172
Rob Avatar answered Sep 29 '22 04:09

Rob


Here's another method that may be easier, if you don't have ready access to command-line and cURL, or you're navigating several layers of CDN (e.g. if your HTTP/2 is being provided by a provider like CloudFlare).

  1. Open Chrome Dev Tools (Ctrl-Shift-I)
  2. Open the Network tab
  3. If your page has already loaded, you may need to refresh (Ctrl-R)
  4. Right-click on the header row of the request list (the row labelled: Name, Method, Status, etc.)
  5. Select Protocol from the context menu.
  6. You may need to refresh again (Ctrl-R), and you will see all the protocols being used.

Chrome Dev Tools Screenshot.

If you see h2, then congratulations! Your website is being served over HTTP/2.

like image 20
haz Avatar answered Sep 29 '22 05:09

haz