You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
50
64
51
65
* 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.
52
66
* static library will be tried prior to dynamic library, since this Nginx module uses some **advanced APIs** where static linking is recommended.
53
67
* 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.
54
69
55
70
# Directives
56
71
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
58
77
59
78
**Syntax:***zstd_dict_file /path/to/dict;*
60
79
**Default:***-*
61
80
**Context:***http*
62
81
63
82
Specifies the external dictionary.
64
83
65
-
## zstd
84
+
###zstd
66
85
67
86
**Syntax:***zstd on | off;*
68
87
**Default:***zstd off;*
69
88
**Context:***http, server, location, if in location*
70
89
71
90
Enables or disables zstd compression for response.
72
91
73
-
## zstd_comp_level
92
+
###zstd_comp_level
74
93
75
94
**Syntax:***zstd_comp_level level;*
76
95
**Default:***zstd_comp_level 1;*
77
96
**Context:***http, server, location*
78
97
79
98
Sets a zstd compression level of a response. Acceptable values are in the range from 1 to `ZSTD_maxCLevel()`.
80
99
81
-
## zstd_min_length
100
+
###zstd_min_length
82
101
83
102
**Syntax:***zstd_min_length length;*
84
103
**Default:***zstd_min_length 20;*
85
104
**Context:***http, server, location*
86
105
87
106
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.
88
107
89
-
## zstd_types
108
+
###zstd_types
90
109
91
110
**Syntax:***zstd_types mime-type ...;*
92
111
**Default:***zstd_types text/html;*
93
112
**Context:***http, server, location*
94
113
95
114
Enables ztd of responses for the specified MIME types in addition to "text/html". The special value "*" matches any MIME type.
96
115
97
-
## zstd_buffers
116
+
###zstd_buffers
98
117
99
118
**Syntax:***zstd_buffers number size;*
100
119
**Default:***zstd_buffers 32 4k | 16 8k;*
101
120
**Context:***http, server, location*
102
121
103
122
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.
104
123
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
+
105
139
# Variables
106
140
107
-
## $zstd_ratio
141
+
## ngx_http_zstd_filter_module
142
+
143
+
### $zstd_ratio
108
144
109
145
Achieved compression ratio, computed as the ratio between the original and compressed response sizes.
0 commit comments