diff options
| author | Andrew Clayton <a.clayton@nginx.com> | 2024-11-20 17:02:22 +0000 |
|---|---|---|
| committer | Andrew Clayton <a.clayton@nginx.com> | 2024-11-29 00:45:24 +0000 |
| commit | 4ddf19c3fccc4265c46139addabe354c99b1587b (patch) | |
| tree | 6b901ace62a90886a0e376fea326700e54bc1d10 /src/nxt_http_request.c | |
| parent | 7a043c0a5e110fb6b8e9e22c958d8bb483101067 (diff) | |
| download | unit-4ddf19c3fccc4265c46139addabe354c99b1587b.tar.gz unit-4ddf19c3fccc4265c46139addabe354c99b1587b.tar.bz2 | |
http: Wire up HTTP compression support to the config system
This exposes a new "settings.http.compression" configuration object.
Under which are types & compressors objects.
types is used to specify what MIME types should be considered
compressible.
compressors is used to configure an array of compressors that are
available. For each of these, you specify the encoding, e.g gzip and
optional level and min_length parameters. Where level is what
compression level to use and min_length is the minimum length of data
that should be compressed.
By default the default compression level for the specified compressor is
used and there is no minimum data length considered for compression.
It may look something like
"settings": {
"http": {
"server_version": true,
"static": {
"mime_types": {
"text/x-c": [
".c",
".h"
]
}
},
"compression": {
"types": [
"text/*"
],
"compressors": [
{
"encoding": "gzip",
"level": 3,
"min_length": 2048
},
{
"encoding": "deflate",
"min_length": 1024
},
{
"encoding": "zstd",
"min_length": 2048
},
{
"encoding": "br",
"min_length": 256
}
]
}
}
},
Currently this is a global option that will effect both static and
application responses.
In future it should be possible to add per-application (and perhaps even
per-static) configuration.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_http_request.c')
0 files changed, 0 insertions, 0 deletions
