当前位置:网站首页>How to achieve efficient network information dissemination
How to achieve efficient network information dissemination
2022-06-23 07:11:00 【Strong learning】
The first point is from the perspective of generating information , That is, the amount of information should be small enough . for instance , from HTTP 1.1 Upgrade to HTTP2 after , stay HTTP 2 Chinese vs HTTP 1.1 Medium REST A large number of... Are transmitted repeatedly in the architecture HTTP header Field , I will use Huffman coding, which is a common compression algorithm . The essence of Huffman coding is to consider the concept of information entropy , Its core principle is to use shorter encoding for repeated words . such as HTTP 2 It's just 5 Bit to write an eight bit single byte number . For those who are very rare, use long codes . In terms of reducing the amount of information , In addition to using Huffman coding , You can also use static tables and dynamic tables .
Static tables are very common for content , For example, the request method is GET、 The response code is 200 And so on Header Information . Hard code them into the middleware code of the client server , For example, it appears i Express GET request , The presence of a number represents POST request . If hard coded into code , It can be well parsed . Static table volume is finite , The most effective method is dynamic table .
Before explaining the dynamic table , First, let's explain the relevance of the time dimension . For example, compress high-definition pictures , If you compress it tenfold , Basically, there is no distortion , But it has reached its limit . But if the HD video is compressed , It can be compressed to 100 Times to 1000 times , But it may not be obvious yet . This is due to the correlation in the time dimension . For example, video per second is 30 Frame or 60 frame , The changes between these frames and their corresponding pictures are very small . So as long as the first frame is designed as a key frame , So as to completely store this picture . The latter frame is only a change increment relative to the first frame , The amount of information in the second and subsequent frames is very small . therefore HTTP2 The dynamic table in is based on the same principle . The first time information is transmitted ,UA May be Chorme Or is it FireFox, But a page may contain hundreds of resources , It may even be repeated for hours , At this point, you can pair this at both ends UA Do dynamic coding , For example, encoding by integer numbers . All you need to do is transfer integer numbers .
边栏推荐
猜你喜欢

MySQL Redo log Redo log

【项目实训】线形箭头的变化

20220621 Dual Quaternion

Chrome remove duplicate bookmarks

How to migrate virtual machines from VirtualBox to hype-v

Regular expression graph and text ultra detailed summary without rote memorization (Part 1)

【BULL中文文档】用于在 NodeJS 中处理分布式作业和消息的队列包
![[project training] change of linear arrow](/img/a4/7554522c13684d7590d247f28a6965.png)
[project training] change of linear arrow

QT设计师无法修改窗口大小,无法通过鼠标拖动窗口改变大小的解决方案

Configuration and compilation of mingw-w64, msys and ffmpeg
随机推荐
Solve the mining virus sshd2 (redis does not set a password and clear the crontab scheduled task)
Why can't the index of JS array use negative numbers
[QT] basic learning notes
初始化层实现
The illustration shows three handshakes and four waves. Xiaobai can understand them
315. calculate the number of elements on the right that are smaller than the current element
295. median data flow
paddle版本问题
深度学习系列47:styleGAN总结
Side effects of threads in embedded real-time systems
.h5文件忘记数据库名字,使用h5py打印
【BULL中文文档】用于在 NodeJS 中处理分布式作业和消息的队列包
Analysis of personalized learning progress in maker Education
306. Addenda
Interpreting the spirit of unity and cooperation in maker Education
[project training] change of linear arrow
Some difficulties in making web pages
[shell] tree command
C language operator priority formula
Using fuser to view file usage