First knowledge of HTTP / 1.1

arthinking 2021-02-23 03:36:25
knowledge http


This paper is about 《 Thirty thousand long articles 50+ Interesting pictures take you to understand web Internal mental skill of programming 》 The second chapter .

2、 First time to know HTTP/1.1

Now let's briefly introduce HTTP/1.1 Advantages and disadvantages , So that we can have an understanding of it , And then we can learn more about .

2.1、 Scalable

Precisely because HTTP There are few restrictions in the specification , Tell you what you can do , But it won't tell you what rules can't do , therefore , It's easy to expand , That's why from HTTP/0.9 Be born , Keep expanding and upgrading , The reason to add more features .

image-20200825221924888

2.2、 Transmission reliability

Because the bottom layer is based on TCP Agreed , So I inherited it TCP Reliability of transmission data , Mainly reflected in 1

  • The sequential transmission of data ;
  • Packet loss retransmission , Make sure it's reliable ;
  • Connection maintenance ;
  • flow control , Keep it stable ;
  • Congestion control , Adjust in time , To maximize the normal transmission .

2.3、 Based on the request response mode

Only one party initiates the connection and request first , The receiver can respond .HTTP It's based on this one question one answer mode . If the client does not request , The server will not take care of the client .

Although behind HTTP/2 There is a server push 2, But it's also a push for specific resources , It's not that the server can push whatever it wants .

2.4、 No state

Having a state means that a certain state must be identified to track the state , It's like TCP State machine ,TCP The request header has a specific status identification bit to maintain the status of the connection .

HTTP There's no place to record status , That is to say, in an interactive scenario ,HTTP No memory . This leads to problems like this :

  • The same user visits a website many times , Need to read repeatedly for authentication .

Even if it's turned on keep-alive Mechanism , Also only TCP The maintenance of the level of connection , about HTTP Layer , It seems to be in a state of no state .

We can't ask users to input their account and password for authentication every time , That's why Cookie and Session, by HTTP Make up for the problem of state storage .

2.5、 Plaintext transmission , unsafe

We use the bag grabbing tool to grab HTTP/1.1 My bag , You can see the contents in the request header and body with the naked eye , So when a user logs in to request , The password of the transmitted account can be captured as follows .

We know , The link of data request in the network is very long , As long as any link catches your bag , Your data is leaked . That's why we're launching HTTPS Why .

2.6、 Poor performance ( request - The reply )

Because of the request response mechanism , You need to send a large request header every time , The efficiency is poor .

in addition ,HTTP/1.1 Based on the request - Response mode , In the application layer, there is the problem of queue head blocking , also TCP There will also be layers TCP The team head block problem , This leads to poor performance , We need to optimize the network request through various tricks .

Efficiency is what drives HTTP/2、HTTP/3 One of the reasons for its birth .


This paper is about arthinking Based on relevant technical data and official documents , Make sure the content is accurate , If you find something wrong , Please raise your hand to help correct , grateful .

If you feel that you have gained from reading this article , Can follow my account , Or like it , It's not easy to code words , Your support is my greatest motivation for writing , Thank you again for !

In order to collect the related articles , Convenient for subsequent reference , Here I create a Github Warehouse , Collect the published articles according to their categories , Interested friends can Star To follow up :

https://github.com/arthinking...

java-tech-stack-info

Follow my blog IT house (itzhai.com) The official account Java Architecture talks , Get the latest articles in time . I will continue to update back-end technologies , involve JVM、Java Basics 、 Architecture design 、 Network programming 、 data structure 、 database 、 Algorithm 、 Concurrent programming 、 Distributed system and other related content .


References

  • Xie Xiren . computer network ( The first 6 edition ). Electronic industry press .
  • TCP/IP Detailed explanation volume 1: agreement ( The book first 2 edition ). Mechanical industry press .
  • UNIX Network programming volume 1: Socket networking API. People's post and Telecommunications Press
  • HTTP Authoritative guide . People's post and Telecommunications Press
  • HTTP/2 Basic course . People's post and Telecommunications Press
  • Liu chao . Talk about network protocol . Geek time
  • Luo Jianfeng . perspective HTTP agreement . Geek time

This article is published in my blog IT house (itzhai.com) and official account (Java Architecture talks )

author : arthinking | official account :Java Architecture talks

Blog links : https://www.itzhai.com/articl...

Copyright notice : The copyright belongs to the author , Shall not be reproduced without permission , Infringement must be investigated ! Please contact the author with the official account. .


  1. Twenty thousand words 50+ Zhang QITU takes you to understand the internal mental skill of network programming -TCP characteristic . Retrieved from https://www.itzhai.com/network/comprehend-the-underlying-principles-of-network-programming.html#4-2-2%E3%80%81TCP%E7%89%B9%E7%82%B9
  2. Technical dry cargo :HTTP/2 Server push (Server Push) Best practices . Retrieved from https://www.infoq.cn/article/qYdN85t4G4dL4vBAe3N2
版权声明
本文为[arthinking]所创,转载请带上原文链接,感谢
https://qdmana.com/2021/02/20210221111837562P.html

  1. An inexperienced front-end engineer, what are the common problems when writing CSS?
  2. HttpServletRequest get URL (parameter, path, port number, protocol, etc.) details
  3. Springboot starts http2
  4. Enabling http2.0 in spring boot
  5. JQuery:JQuery基本语法,JQuery选择器,JQuery DOM,综合案例 复选框,综合案例 随机图片
  6. Using JavaScript in Safari browser history.back () the page will not refresh after returning to the previous page
  7. vue.js Error in win10 NPM install
  8. In less than two months, musk made more than $1 billion, more than Tesla's annual profit
  9. Springboot starts http2
  10. Vue event bus
  11. JQuery easy UI tutorial: custom data grid Pagination
  12. Using okhttp and okhttpgo to obtain onenet cloud platform data
  13. Vue3 component (IX) Vue + element plus + JSON = dynamic rendering form control
  14. HTTP 1. X learning notes: an authoritative guide to Web Performance
  15. Vue3 component (IX) Vue + element plus + JSON = dynamic rendering form control
  16. HTTP 1. X learning notes: an authoritative guide to Web Performance
  17. JQuery:JQuery基本语法,JQuery选择器,JQuery DOM,综合案例 复选框,综合案例 随机图片
  18. Event bubble and capture in JavaScript
  19. The root element is missing solution
  20. Event bubble and capture in JavaScript
  21. Configure the certificate to enable ngnix to publish the trusted website of HTTPS
  22. Javascript数据类型
  23. HTTP interface debugging tool! 48000 star HTTP command line client!
  24. Parameter encryption of front end URL link band
  25. HTTP interface debugging tool! 48000 star HTTP command line client!
  26. Three front end frameworks: data binding and data flow
  27. Reading Axios source code (1) -- exploring the realization of basic ability
  28. Event bubble and capture in JavaScript
  29. 【微前端】微前端最終章-qiankun指南以及微前端整體探索
  30. R & D solution e-Car front end monitoring system
  31. [JS] 877 - 35 wonderful knowledge of JavaScript, long experience!
  32. R & D solution e-Car front end monitoring system
  33. High performance nginx HTTPS tuning - how to speed up HTTPS by 30%
  34. 解决ajax跨域问题【5种解决方案】
  35. Top ten classic sorting of JavaScript
  36. HTTP 1. X learning notes: an authoritative guide to Web Performance
  37. Vue3 component (IX) Vue + element plus + JSON = dynamic rendering form control component
  38. My http / 1.1 is so slow!
  39. Why Vue uses asynchronous rendering
  40. The response status was 0. Check out the W3C XMLHttpRequest Level 2 spec for
  41. The tapable instance object hook of webpack4. X core tool library
  42. The tapable instance object hook of webpack4. X core tool library
  43. Using libcurl for HTTP communication in C + +
  44. Using libcurl for HTTP communication in C + +
  45. Using CSS variable in Vue
  46. Deeply understand the update of state and props in react
  47. No matter how fast the Internet is, it's useless! In addition to Baidu disk, there is this website slow to let you eat shriveled
  48. Baidu share does not support the solution of HTTPS
  49. [micro front end] the final chapter of micro front end - Qiankun guide and overall exploration of micro front end
  50. [micro front end] the final chapter of micro front end - Qiankun guide and overall exploration of micro front end
  51. Vue cli creates vue3 project
  52. Nginx reverse proxy for windows authentication using NTLM
  53. Rust tutorial: introduction to rust for JavaScript developers
  54. Deploying personal blog to Tencent cloud with serverless framework
  55. R & D solution e-Car front end monitoring system
  56. JavaScript advanced learning
  57. Spend 1 minute to master these 5 ppt tips, courseware making less detours
  58. Vue: vuex persistent state
  59. React native gets the current network state of the device Netinfo
  60. High performance nginx HTTPS tuning - how to speed up HTTPS by 30%