当前位置:网站首页>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 .
边栏推荐
猜你喜欢

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

图解三次握手四次挥手,小白都能看懂

宝塔忘记密码

QT设计师无法修改窗口大小,无法通过鼠标拖动窗口改变大小的解决方案
![[STL] summary of deque usage of sequential containers](/img/33/65c54d14697ee43b2655ea1255d67d.png)
[STL] summary of deque usage of sequential containers

Idea installing the cloudtoolkit plug-in

Interpreting the spirit of unity and cooperation in maker Education

Xiaobai must see in investment and wealth management: illustrated fund buying and selling rules

PSP代码实现

MySQL optimization
随机推荐
[STL] summary of map usage of associated containers
20220621 Three Conjugates of Dual Quaternions
318. maximum word length product
【日常训练】513. 找树左下角的值
[bull Chinese document] queue package used to process distributed jobs and messages in nodejs
316. 去除重复字母
20220621 Dual Quaternion
deeplab v3 代码结构图
GINet
295. median data flow
Configuration and compilation of mingw-w64, msys and ffmpeg
312. poke the balloon
初始化层实现
关于五险一金你需要知道的事情
ssm + ftp +ueditor
1161 Merging Linked Lists
A small method of debugging equipment serial port information with ADB
303. region and retrieval - array immutable
[project training 10] drawing of arrows
数据统计与分析基础 实验一 基本语法及运算