博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Say Hello to HTTP/2
阅读量:6805 次
发布时间:2019-06-26

本文共 3058 字,大约阅读时间需要 10 分钟。

hot3.png

 was born in 1999, and the web has evolved a lot in the last decade.  Because of HTTP/1.x, the web has many performance issues, and many developers have found hacks to overcome it. Below are some of the hacks which we used to improve the web performance.

  • As HTTP/1.x opens the new TCP connection for each request, downloading many files from the single server become more resource intensive causing a bottleneck for performance. To avoid it:

    • Use the CSS sprites, in which you download a bigger image containing the smaller images in it and show/hide at the client side.

    • Minify CSS and JS files and lossless compression of the images to reduce the number of bytes to download via network while reducing the resource download time.

    • Merge the multiple CSS and JS files into one, so that the number of requests will be reduced.

    • Host the assets like images into different domains or CDN, this way multiple servers will serve the content to the web page.

To help overcome performance problems addressed by the above-mentioned hacks, the Google team came up with (Pronounce as “SPEEDY”) protocol and the same technique is used as part of Google Chrome browser. Now, the same team thought to revamp HTTP/1.1 and proposed . The teams from Facebook, Amazon, and others came together  to be part of the Hypertext Transfer Protocol working group (IETF).

 Now, Let's see what features  will provide.

  • Multiplexing (Open a single TCP connection and reuse the same for other requests).

  • Server Push (Pushing the content from the server to user agent, before the client is asking).

  • Compression of HTTP headers.

  • Prioritization of resource (download the highest priority resource first, then the other one).

  • Binary framing layer (not compatible with HTTP/1.1)

Now, as web developers, we might have a lot of questions about adapting  HTTP/2. Below are few of the questions.

  1. Is there any change to the HTTP status codes, HTTP methods, Header fields, etc..?

  2. Do I need to change my code to adhere to HTTP/2?

  3. Do I need to change my web server to work with HTTP/2?

  4. Do I need to change the web browser to utilize HTTP/2?

As developers, we don't need to think about question 1 and 2 from the above list. There are no changes to HTTP status codes, HTTP methods, header fields, etc. and we don't need to change our code that is working for HTTP/1.1. HTTP/2 has backward compatibility to work with HTTP/1.1. For Question 3 and 4, yes we need to change the web server and the browser to offer support for HTTP/2. Below is the information about the web servers and the browser releases.

Browsers

  • Mozilla Firefox provides support for HTTP/2 from 

  • Google chrome provided support from release 40 onward

  • Safari 8

  • Internet Explorer supports HTTP/2 in version 11, but only for Windows 10 beta

Webservers

  • IIS, on Windows 10 offers full support for HTTP/2

  • Since 2015,  has been ready to support HTTP/2

  • Apache—not sure when HTTP/2 support will be provided

If you have any more info about HTTP/2, you can discuss as part of comments. Till then, Happy Exploring!

转载于:https://my.oschina.net/u/698683/blog/648840

你可能感兴趣的文章
解决Android版Firefox字体显示过大的问题
查看>>
使用new Vue实例的 components 属性定义 私有组件 login
查看>>
[C++]一份Linq to object的C++实现
查看>>
Linux相关的入门命令
查看>>
Android 关于ijkplayer
查看>>
LVS介绍与部署
查看>>
【Lolttery】项目开发日志 - (三)维护好一个项目好难
查看>>
数据库面试题
查看>>
C#的OpenFileDialog和SaveFileDialog的常见用法(转)
查看>>
(转)详解C#中的反射
查看>>
超简单将Centos的yum源更换为国内的阿里云源
查看>>
(转)返回顶部的js实现(jQuery/MooTools)
查看>>
十大最值得关注的国内大数据分析厂商
查看>>
Flask 学习 六 大型程序结构
查看>>
关于JavaScript的事件触发
查看>>
拓扑排序(topsort)
查看>>
助教学习总结
查看>>
VS中基于对话框的MFC利用换肤改变边框颜色及格式
查看>>
CSS3 Transitions
查看>>
[BZOJ1501/NOI2005]智慧珠游戏
查看>>