Skip to content

Commit 12c0d94

Browse files
committed
doc: added the zstd_static descriptions
1 parent 1ba7af9 commit 12c0d94

File tree

1 file changed

+51
-15
lines changed

1 file changed

+51
-15
lines changed

README.md

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ zstd-nginx-module - Nginx module for the [Zstandard compression](https://faceboo
88
* [Synopsis](#synopsis)
99
* [Installation](#installation)
1010
* [Directives](#directives)
11-
* [zstd_dict_file](#zstd_dict_file)
12-
* [zstd](#zstd)
13-
* [zstd_comp_level](#zstd_comp_level)
14-
* [zstd_min_length](#zstd_min_length)
15-
* [zstd_types](#zstd_types)
16-
* [zstd_buffers](#zstd_buffers)
11+
* [ngx_http_zstd_filter_module](#ngx_http_zstd_filter_module)
12+
* [zstd_dict_file](#zstd_dict_file)
13+
* [zstd](#zstd)
14+
* [zstd_comp_level](#zstd_comp_level)
15+
* [zstd_min_length](#zstd_min_length)
16+
* [zstd_types](#zstd_types)
17+
* [zstd_buffers](#zstd_buffers)
18+
* [ngx_http_zstd_static_module](#ngx_http_zstd_static_module)
19+
* [zstd_static](#zstd_static)
1720
* [Variables](#variables)
18-
* [$zstd_ratio](#$zstd_ratio)
21+
* [ngx_http_zstd_filter_module](#ngx_http_zstd_filter_module)
22+
* [$zstd_ratio](#$zstd_ratio)
1923
* [Author](#author)
2024

2125
# Status
@@ -42,69 +46,101 @@ server {
4246
proxy_pass http://foo.com;
4347
}
4448
}
49+
50+
server {
51+
listen 127.0.0.1:8081;
52+
server_name localhost;
53+
54+
location / {
55+
zstd_static on;
56+
root html;
57+
}
58+
}
4559
```
4660

4761
# Installation
4862

49-
To use this module, configure your nginx branch with `--add-module=/path/to/zstd-nginx-module`. Several points should be taken care.
63+
To use theses modules, configure your nginx branch with `--add-module=/path/to/zstd-nginx-module`. Several points should be taken care.
5064

5165
* You can set environment variables `ZSTD_INC` and `ZSTD_LIB` to specify the path to `zstd.h` and the path to zstd shared library represently.
5266
* static library will be tried prior to dynamic library, since this Nginx module uses some **advanced APIs** where static linking is recommended.
5367
* System's zstd bundle will be linked if `ZSTD_INC` and `ZSTD_LIB` are not specified.
68+
* Both `ngx_http_zstd_static_module` and `ngx_http_zstd_filter_module` will be configured.
5469

5570
# Directives
5671

57-
## zstd_dict_file
72+
## ngx_http_zstd_filter_module
73+
74+
The `ngx_http_zstd_filter_module` module is a filter that compresses responses using the "zstd" method. This often helps to reduce the size of transmitted data by half or even more.
75+
76+
### zstd_dict_file
5877

5978
**Syntax:** *zstd_dict_file /path/to/dict;*
6079
**Default:** *-*
6180
**Context:** *http*
6281

6382
Specifies the external dictionary.
6483

65-
## zstd
84+
### zstd
6685

6786
**Syntax:** *zstd on | off;*
6887
**Default:** *zstd off;*
6988
**Context:** *http, server, location, if in location*
7089

7190
Enables or disables zstd compression for response.
7291

73-
## zstd_comp_level
92+
### zstd_comp_level
7493

7594
**Syntax:** *zstd_comp_level level;*
7695
**Default:** *zstd_comp_level 1;*
7796
**Context:** *http, server, location*
7897

7998
Sets a zstd compression level of a response. Acceptable values are in the range from 1 to `ZSTD_maxCLevel()`.
8099

81-
## zstd_min_length
100+
### zstd_min_length
82101

83102
**Syntax:** *zstd_min_length length;*
84103
**Default:** *zstd_min_length 20;*
85104
**Context:** *http, server, location*
86105

87106
Sets the minimum length of a response that will be compressed by zstd. The length is determined only from the "Content-Length" response header field.
88107

89-
## zstd_types
108+
### zstd_types
90109

91110
**Syntax:** *zstd_types mime-type ...;*
92111
**Default:** *zstd_types text/html;*
93112
**Context:** *http, server, location*
94113

95114
Enables ztd of responses for the specified MIME types in addition to "text/html". The special value "*" matches any MIME type.
96115

97-
## zstd_buffers
116+
### zstd_buffers
98117

99118
**Syntax:** *zstd_buffers number size;*
100119
**Default:** *zstd_buffers 32 4k | 16 8k;*
101120
**Context:** *http, server, location*
102121

103122
Sets the number and size of buffers used to compress a response. By default, the buffer size is equal to one memory page. This is either 4K or 8K, depending on a platform.
104123

124+
## ngx_http_zstd_static_module
125+
126+
The `ngx_http_zstd_static_module` module allows sending precompressed files with the ".zst" filename extension instead of regular files.
127+
128+
### zstd_static
129+
130+
**Syntax:** *zstd_static on | off | always;*
131+
**Default:** *gzip_static off;*
132+
**Context:** *http, server, location*
133+
134+
Enables ("on") or disables ("off") checking the existence of precompressed files. The following directives are also taken into account: gzip_vary.
135+
136+
With the "always" value, "zsted" file is used in all cases, without checking if the client supports it.
137+
138+
105139
# Variables
106140

107-
## $zstd_ratio
141+
## ngx_http_zstd_filter_module
142+
143+
### $zstd_ratio
108144

109145
Achieved compression ratio, computed as the ratio between the original and compressed response sizes.
110146

0 commit comments

Comments
 (0)