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

Firewalld 防火墙

Conditional statement of shell script

PXE automated installation

SQL之CASE WHEN用法详解

A preliminary study of MySQL

Shell script integer value comparison, logic test, if statement, extract performance monitoring indicators

责任链模式的高级用法

The difference between cookies and sessions

Services for NFS

Comprehensive experiment of static routing
随机推荐
Understand the switch and its role
Rip comprehensive experiment
rsync—远程同步
TCP的三次握手与四次断开
RHCE8学习指南 第7章 服务管理
高质量的子程序
Dynamic programming problem - Small Soldiers rush forward
Yum warehouse service and PXE automatic deployment system
Swagger -- the most popular API framework in the world
Test knowledge preparation
Upgrade kubernetes 1.23.2 to 1.24.1
SSH远程控制与访问
Flyway's SaaS multi tenant implementation scheme
静态路由综合实验
OSPF综合实验
让我们了解awk~
FTP service
Understand network namespaces
GFS分布式文件系统
PXE automated installation