{"id":31231,"date":"2015-02-27T20:08:17","date_gmt":"2015-02-27T18:08:17","guid":{"rendered":"https:\/\/blog.superhosting.bg\/?p=31231"},"modified":"2022-04-02T09:43:10","modified_gmt":"2022-04-02T06:43:10","slug":"new-http2","status":"publish","type":"post","link":"https:\/\/blog.superhosting.bg\/en\/new-http2.html","title":{"rendered":"Even Faster Web with HTTP\/2"},"content":{"rendered":"\n<p class=\"has-text-align-left\">Version&nbsp;<strong>2.0<\/strong>&nbsp;(<a title=\"HTTP\/2 Frequently Asked Questions\" href=\"http:\/\/http2.github.io\/faq\" target=\"_blank\" rel=\"noopener noreferrer\">HTTP\/2<\/a>) of the&nbsp;HTTP protocol&nbsp;for data transfer on the&nbsp;Web, is&nbsp;<a title=\"HTTP\/2 Approved - IETF\" href=\"http:\/\/www.ietf.org\/blog\/2015\/02\/http2-approved\" target=\"_blank\" rel=\"noopener noreferrer\">finally complete<\/a>&nbsp;and all is left now is to standardize it.<\/p>\n\n\n\n<p>Over the last years we\u2019ve seen a frequent updating of web browsers and web technologies. But they all depend on the main driving component \u2013 the HTTP protocol which is used to transfer data on the Web.<\/p>\n\n\n\n<p><span style=\"line-height: 1.5em;\">And <\/span>while they constantly improve the way they operate, the HTTP protocol has not gone through any changes for 15 years now<span style=\"line-height: 1.5em;\">.&nbsp;<\/span>That is why the news about a new HTTP, that is faster and catches up with the rest of the Web components, is a quite refreshing one.<\/p>\n\n\n\n<p>HTTP 1.1 (<em>dated 1999<\/em>) has been powering up the Web for years now, but the time has come for something new, better and in line with the modern online world.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"boxheadlinefs15p5mb12eee\">What is HTTP\/2?<\/h2>\n\n\n\n<p>HTTP\/2 is the new version of the HTTP protocol. This version is based on the&nbsp;<a title=\"SPDY - The Chromium Projects\" href=\"http:\/\/www.chromium.org\/spdy\" target=\"_blank\" rel=\"noopener noreferrer\">SPDY<\/a> protocol, developed by Google to speed up web sites. HTTP\/2 is a modern protocol with a new way to transfer data between a web server and a web browser, which significantly speeds up the loading of web content. Some of the advantages of this new protocol are the following: improved speed, low bandwidth, better connection management and more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"boxheadlinefs15p5mb12eee\">The main differences between HTTP\/2 and HTTP\/1.x in brief<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The protocol is now binary<\/h3>\n\n\n\n<p><em><strong>The protocol is now binary (01000110\u2026), instead of text (GET \/index.html)<\/strong><\/em>and uses&nbsp;<a title=\"Multiplexing - Wikipedia\" href=\"https:\/\/en.wikipedia.org\/wiki\/Multiplexing\" target=\"_blank\" rel=\"noopener noreferrer\">multiplexing<\/a>&nbsp;of the client-server communication.<\/p>\n\n\n\n<p>Two new data transfer components are introduced &#8211;&nbsp;<a title=\"HTTP Frames\" href=\"https:\/\/hpbn.co\/http2\/#binary-framing-layer\" target=\"_blank\" rel=\"noopener noreferrer\">Frame<\/a>&nbsp;(frame, containing the data) and <a title=\"Streams and Multiplexing\" href=\"https:\/\/hpbn.co\/http2\/#streams-messages-and-frames\" target=\"_blank\" rel=\"noopener noreferrer\">Stream<\/a>&nbsp;(the stream through which the frames are exchanged). The data between a web server and a web browser is divided into parts and is packed into frames before being sent via the HTTP\/2-<a title=\"Transmission Control Protocol - Wikipedia\" href=\"https:\/\/en.wikipedia.org\/wiki\/Transmission_Control_Protocol\" target=\"_blank\" rel=\"noopener noreferrer\">TCP connection<\/a>. There are several types of frames \u2013 header frame, data frame and&nbsp;<a title=\"Frame Definitions\" href=\"https:\/\/developers.google.com\/web\/fundamentals\/performance\/http2\" target=\"_blank\" rel=\"noopener noreferrer\">others<\/a>.<\/p>\n\n\n\n<p>The HTTP\/2-TCP network connection is a communication channel in the virtual space between a client and a server. A large number of data streams can be created and utilized within this communication channel. The stream is an independent thread of consecutively arranged frames flying both ways between client and a server. The frames within a single stream carry the stream\u2019s identificator (a unique stream number). Both ends of the communication connection \u2013 the server and the client may take and rearrange frames from a multitude of various streams at the same time.<\/p>\n\n\n\n<p>With HTTP 1.1, a single web client may only request a single resource at a given time using an HTTP\/TCP connection. Each of those sent requests is received and processed in a consecutive order. The new HTTP\/2 uses multiplexing of the requests and many requests may be \u201dattached\u201d to a single TCP connection at the same time. A priority may be assigned to each request. For example, some parts of the web site, such as the HTML code and the .css may be loaded before the images.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Uses header compression<\/h3>\n\n\n\n<p>To compress the header, a specially created&nbsp;<a title=\"HPACK - Header Compression for HTTP\/2\" href=\"https:\/\/hpbn.co\/http2\/#header-compression\" target=\"_blank\" rel=\"noopener noreferrer\">HPACK<\/a> algorithm is used. The decreased volume of the constantly transferred headers between a client and a server significantly decreases the loading time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Allows the web server to send data to the client<\/h3>\n\n\n\n<p><strong><em>Allows the web server to send data to the client by the server\u2019s own initiative (server-push)<\/em><\/strong>, even before requested.<\/p>\n\n\n\n<p>This new function for the web server tremendously speeds up web content loading time. The web server may offer to the web browser the additional elements of the web page, without waiting for a specific request for that. Up until now, when a web browser received and read the HTML code of a web page, the browser would send additional request to the web server for the additional resources (for example images and scripts). Instead, the web server will now know what are the additional elements on the web page and will offer them to the web browser right away, without additional requests and lag.<\/p>\n\n\n\n<p>In the HTTP\/2 protocol there is an option that is sparing the mobile clients who may decline to automatically receive data from the server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"boxheadlinefs15p5mb12eee\">There are talks on the web about another HTTP protocol &#8211; SPDY\/2. What does it have to do with HTTP\/2?<\/h2>\n\n\n\n<p>Firstly, the common thing between them is in the idea for a faster and more secure Web for all, but the most important thing is that the HTTP\/2 is based on SPDY.<\/p>\n\n\n\n<p>SPDY is an HTTP compatible protocol developed by Google in 2012 and is supported by several web browsers such as Chrome, Opera, Firefox, Internet Explorer 11, Safari and Amazon Silk.<\/p>\n\n\n\n<p>Many of the capabilities of the SPDY protocol are implemented in the new HTTP version such as multiplexing of the requests, headers compression, stream priority, sending data from the server (server-push) and more.<\/p>\n\n\n\n<p>Google announced their plans to migrate to HTTP\/2 by the beginning of 2016, discontinuing the support of SPDY (<a title=\"Google: Hello, HTTP\/2, goodbye SPDY\" href=\"https:\/\/web.archive.org\/web\/20160210091903\/http:\/\/blog.chromium.org\/2015\/02\/hello-http2-goodbye-spdy-http-is_9.html\" target=\"_blank\" rel=\"noopener noreferrer\">Google: Hello, HTTP\/2, goodbye SPDY<\/a>).<\/p>\n\n\n\n<p>In Internet Explorer SPDY is already&nbsp;in a deprecated status.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"boxheadlinefs15p5mb12eee\">Distribution and support of the new HTTP\/2 protocol<\/h2>\n\n\n\n<p>The HTTP\/2 protocol is already supported by the most popular web browsers such as Mozilla Firefox and Google Chrome. The developers of both web browsers have announced that the support of the HTTP\/2 protocol will only apply to instances where a secure connection is used (https).<\/p>\n\n\n\n<p>HTTP\/2 is supported and is activated by default&nbsp;<a title=\"Networking\/http2 - Mozilla\" href=\"https:\/\/wiki.mozilla.org\/Networking\/http2\" target=\"_blank\" rel=\"noopener noreferrer\">since Firefox 34<\/a>. In the settings page of Firefox,&nbsp;<strong>about:config<\/strong>, for the option &#8220;<strong>network.http.spdy.enabled.http2draft<\/strong>&#8221; the value should be&nbsp;<strong>true<\/strong>.<\/p>\n\n\n\n<p>If you are using Mozilla Firefox you may see HTTP\/2 in action right away by making sure the option above is activated, and by visiting any web site through a secure connection. Make sure the site also supports HTTP\/2, for example&nbsp;<a title=\"Google Analytics\" href=\"https:\/\/www.google.com\/analytics\" target=\"_blank\" rel=\"noopener noreferrer\">Google Analytics<\/a>.<\/p>\n\n\n\n<p>To see which protocol is used when connecting to the web site, open the developer tool in Firefox &#8211;&nbsp;<strong>Tools<\/strong>&nbsp;-&gt;&nbsp;<strong>Web Developer<\/strong>&nbsp;-&gt;&nbsp;<strong>Web Console<\/strong>&nbsp;(or key shortcut&nbsp;<strong>Ctrl+Shift+K<\/strong>). You will see something similar. If necessary, reload the page after opening the console (Ctrl+F5):<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"\/wp-content\/uploads\/2015\/02\/http2-b.png\"><img decoding=\"async\" src=\"\/wp-content\/uploads\/2015\/02\/http2-a.png\" alt=\"HTTP\/2 in Mozilla Firefox web browser\" class=\"wp-image-23059\" title=\"HTTP\/2 in Mozilla Firefox web browser\"\/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\"><\/p>\n\n\n\n<p><span style=\"line-height: 1.5em;\">While the HTTP\/2 protocol is already supported by the most popular web browsers, some server applications are still waiting for implementation. For the time being, if you want to test the new HTTP, you can take a look at the&nbsp;<\/span><a style=\"line-height: 1.5em;\" title=\"HTTP\/2 Server, Client Implementations\" href=\"https:\/\/github.com\/http2\/http2-spec\/wiki\/Implementations\" target=\"_blank\" rel=\"noopener noreferrer\">complete implementations<\/a><span style=\"line-height: 1.5em;\">&nbsp;node-http2 (Node.js), http-2 (Ruby) and others.<\/span><\/p>\n\n\n\n<p>For now we are still waiting for the Apache web server to officially include support for the new HTTP\/2 protocol.<\/p>\n\n\n\n<div class=\"hint-note\"><strong>Curious: <\/strong>In 2012, around the same time when the <a title=\"SPDY Protocol\" href=\"http:\/\/tools.ietf.org\/html\/draft-mbelshe-httpbis-spdy-00\" target=\"_blank\" rel=\"noopener noreferrer\">SPDY protocol<\/a> by Google seemed like the only logical proposal for a version 2 of the HTTP, Microsoft <a title=\"S&amp;M vs. SPDY: Microsoft and Google battle over the future of HTTP 2.0\" href=\"http:\/\/www.extremetech.com\/computing\/124153-sm-vs-spdy-microsoft-and-google-battle-over-the-future-of-http-2-0\" target=\"_blank\" rel=\"noopener noreferrer\">launched<\/a> a <a title=\"Speed and Mobility: An Approach for HTTP 2.0 to Make Mobile Apps and the Web Faster\" href=\"https:\/\/www.networkworld.com\/article\/2221256\/microsoft-s-proposal-to-accelerate-mobile-apps-and-the-web--http-speed-mobility.html\" target=\"_blank\" rel=\"noopener noreferrer\">competitive protocol<\/a> &#8211; HTTP <a title=\"HTTP Speed+Mobility\" href=\"https:\/\/tools.ietf.org\/html\/draft-montenegro-httpbis-speed-mobility-02\" target=\"_blank\" rel=\"noopener noreferrer\">S&amp;M<\/a> (<strong>S<\/strong>peed+<strong>M<\/strong>obility).<\/div>\n\n\n\n<div class=\"hint-info\"><strong>Test<\/strong> and see for yourself the difference between HTTP\/2 and HTTP\/1 when loading images&nbsp;(in HTTP\/2 one can properly see the parallel loading of resources).<\/div>\n","protected":false},"excerpt":{"rendered":"<p>HTTP\/2 is a modern protocol with a new way to transfer data between a web server and a web browser, which significantly speeds up the loading of web content. <\/p>\n","protected":false},"author":16,"featured_media":31251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[110],"tags":[224],"class_list":{"0":"post-31231","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-superhosting-technology-en","8":"tag-website-speed-up"},"aioseo_notices":[],"modified_by":"\u041c\u0430\u0434\u043b\u0435\u043d\u0430 \u041c\u0435\u0442\u043e\u0434\u0438\u0435\u0432\u0430","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/31231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/comments?post=31231"}],"version-history":[{"count":10,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/31231\/revisions"}],"predecessor-version":[{"id":64886,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/31231\/revisions\/64886"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media\/31251"}],"wp:attachment":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media?parent=31231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/categories?post=31231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/tags?post=31231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}