当前位置:网站首页>Polling and connection
Polling and connection
2022-06-23 21:14:00 【thissuper】
Polling and long polling
polling : The client requests the server regularly , The client actively requests to update the data
- It consumes a lot of server memory and broadband resources , Because the server keeps requesting , A lot of times No new data updates , Therefore, most requests are invalid requests
- Data is not necessarily updated in real time , It depends on the set request interval , Basically there will be delays .
Long polling : The client requests the server , But the server does not return , Instead, the content is returned to the client only when it is updated
- Solved two major problems of polling , Real time data update ;
- The only disadvantage is that the server consumes more memory when it is suspended .
A long connection 、 Short connection ?
stay HTTP/1.0 Short connection is used by default in . in other words , Client and server every time HTTP operation , Just one connection , Disconnect at end of task . When a client browser accesses HTML Or other types Web The page contains other Web resources ( Such as JavaScript file 、 image file 、CSS Documents, etc. ), Every time I meet such a Web resources , The browser will recreate a HTTP conversation .
And from HTTP/1.1 rise , Use long connection by default , To maintain connection characteristics . Using long connected HTTP agreement , Will be added to the response header
Connection:keep-alive
With long connections , When a web page is opened , Transport between client and server HTTP Data TCP Connection will not close , When the client accesses this server again , Will continue to use this established connection .Keep-Alive Not permanently connected , It has a hold time , Different server software is available ( Such as Apache) Set this time in . To realize long connection, both client and server need to support long connection .
HTTP Long connection and short connection of protocol , Is essentially TCP Long connection and short connection of protocol .
In a long connected application scenario ,client Generally, the terminal will not actively close the connection , When client And server The connection between has not been closed , With more and more client connections ,server Will keep too many connections .
边栏推荐
- Global and Chinese market of American football catch gloves 2022-2028: Research Report on technology, participants, trends, market size and share
- [typescript] some summaries in actual combat
- How to build a personal cloud game server? How many games can the cloud game platform install?
- Gin security -3: fast implementation of CSRF verification
- Global and Chinese market of gas fire pit 2022-2028: Research Report on technology, participants, trends, market size and share
- Process crash does not generate dump. Configure localdumps
- Easyplayer player error 502 bad gateway problem analysis
- [golang] quick review guide quickreview (I) -- string
- Install bitgarden open source password manager
- SAP FICO as03 display fixed assets master data
猜你喜欢
Application of JDBC in performance test

How does PMO select and train project managers?

How PMO uses two dimensions for performance appraisal

3000 frame animation illustrating why MySQL needs binlog, redo log and undo log

How to view the role of PMO in agile organizations?

How to gradually improve PMO's own ability and management level

Steps for formulating the project PMO strategic plan

What are the main dimensions of PMO performance appraisal?

Applet development framework recommendation

Four aspects of PMO Department value assessment
随机推荐
Use of paging components in fusiondesign
How to solve the problem that the ID is not displayed when easycvr edits the national standard channel?
Four aspects of PMO Department value assessment
Dart series: your site is up to you. Use extension to extend classes
How to build a personal cloud game server? How many games can the cloud game platform install?
Nodejs operation state keeping technology cookies and sessions
This article introduces you to the necessity of database connection pooling
More than 1200 phishing kits that can intercept 2fa detected in the field
Where should DNS start? I -- from the failure of Facebook
数字电路概述
Which is better for securities companies? I don't understand. Is it safe to open an account online?
[typescript] some summaries in actual combat
Spend small money to do big things: cloud function + cloud development leverages the practice of e-commerce promoting flexible architecture in CCTV evening party
Is it safe to open an online securities account or to go to the business department
Command line add user set password never expires add remote group add administrator group
JS mailbox regular expression
How to build Tencent cloud game server? Differences between cloud game platforms and ordinary games
What software is safe to use to fight new debts? What are the new bond platforms
[open source] goravel (golang Web Framework) - new cache module
Why is it invalid to assign values to offsetwidth and offsetHeight