当前位置:网站首页>Detailed explanation of dynamic compression and static compression of gzip
Detailed explanation of dynamic compression and static compression of gzip
2022-07-19 02:53:00 【dragonpeng2008】
Gzip The compression of is divided into dynamic compression and static compression . Dynamic compression is simply nginx The resources on are in the form of original files , Compress it when it is returned to the browser , The browser receives the compressed file and decompresses it . Static compression is nginx The resource on is not the original file , It is a compressed file compressed in advance , Directly back to the browser , The browser will decompress .
One 、Gzip Dynamic compression
Be careful :gzip After dynamic compression of is enabled ,sendfile Zero copy of is invalid .
Scope http, server, location
Configuration parameter description :
1、gzip on;
switch , Off by default
2、gzip_buffers 32 4k
Buffer size , Ahead 32 To express with 32 Buffers , Next, the size of each buffer is 4K,32 Bit operating system recommended configuration 32 4k,64 Bit operating system recommended configuration 16 8k
3、gzip_comp_level 1;
Compression level 1-9, The larger the number, the higher the compression ratio
4、gzip_http_version 1.1;
Use gzip The smallest version of
5、gzip_min_length
Settings will be gzip Minimum length of compressed response . Length only by “Content-Length” The response header field is determined . Compress only after exceeding this value , Less than this value will not compress . With K In units of , The duty of 0 when , All pages are compressed
6、gzip_proxied
As a reverse agent , Judge whether to compress according to the header information returned by the upstream server , If nginx Not as a reverse proxy server , For example, static resource server , be gzip_proxied Invalid configuration
gzip_proxied Are the following parameters , Multiple values can be selected :
- off Turn off compression of data for all agent results
- expired - Qi
边栏推荐
猜你喜欢
随机推荐
【NoSQL】redis主从、哨兵、集群
对工作节点执行drain操作时,通过pdb保护pod副本数
MySQL differential deletion and modification check user login and password modification
Squid agent service deployment
Oracle获取最后一条,第一条数据(按时间获取第一条和最后一条数据)
多层数据包结构及TCP三次握手
二进制安装kubernetes 1.23.2
SSH Remote Control and access
Usage instructions for MDK keil/arm printf
单片机之数码管秒表的动态显示
SQL之CASE WHEN用法详解
描述DNS解析的工作过程
MDK Keil/ARM printf 用法说明
责任链模式的高级用法
RHCE8学习指南 第4章 获取帮助
Rhce8 Learning Guide Chapter 4 getting help
Common English business mail phrases
正则表达式
Dynamic programming problem - Small Soldiers rush forward
MySQL备份和恢复









