Its 2018 and its a long overdue performance upgrade from the 1999 HTTP 1.0 and 1.1 Specs. Its promise is to reduce the perceived load time in user perspective and also have more efficient use of server and network usage.
So lets try out and see if we could have more optimized results on one of my development environment.
The test would be using a single website, cache disabled using Chrome so that we could have a measuring tool for performance. We would perform two tests, before and after we turn-on the HTTP/2 version on our web servers.
My development site using HTTP 1.1
Same development site upgraded to HTTP/2:
Response time results: HTTP/2 Performs better in returning individual resources from the server.
Type | HTTP 1.1 | HTTP/2 | |
Initial Document | HTML | 346 MS | 57 MS |
SVG Image | XML | 165 MS | 47 MS |
Site.min.js | JS | 65 MS | 43 MS |
Site.min.css | CSS | 57 MS | 48 MS |
Select2.min.js | JS | 85 MS | 84 MS |
Select2.min.css | CSS | 121 MS | 49 MS |
Size results: HTTP/2 Do compress the content, this shows that files served thru HTTP/2 is lower in size.
Type | HTTP 1.1 | HTTP/2 | |
Initial Document | HTML | 2.6 KB | 2.4 KB |
SVG Image | XML | 1.4 KB | 1.2 KB |
Site.min.js | JS | 603 B | 203 B |
Site.min.css | CSS | 1.4 KB | 1.1 KB |
Select2.min.js | JS | 25.1 KB | 24.8 KB |
Select2.min.css | CSS | 3.1 KB | 2.8 KB |
Domain sharding Results: Need more verifications (Am sleepy na)
According to the previous spec (8.1.4 Practical Considerations) a client should not maintain 2 connections with any server or proxy. Thus we had to do a workaround where resources are located on a different server (Or in our case, different DNS name or using a Content Delivery Network). Now from our results:
I am thinking about not using CDN anymore if they are still using SPDY or 1.1, however looking at the results, cached:
Enabling HTTP/2
How did I enable HTTP/2. This site is hosted in Azure as an app service. To enable, search for the HTTP version on the Application Settings. Click save and refresh.
For the on-premise-premise, HTTP/2 is also available on Windows Server 2016/IIS 10 and Windows 10.