2021-03-30 03:47:19 +03:00
|
|
|
:80
|
|
|
|
|
2021-05-10 19:06:38 +03:00
|
|
|
# All the options
|
2021-03-30 03:47:19 +03:00
|
|
|
encode gzip zstd {
|
|
|
|
minimum_length 256
|
|
|
|
match {
|
|
|
|
status 2xx 4xx 500
|
|
|
|
header Content-Type text/*
|
|
|
|
header Content-Type application/json*
|
|
|
|
header Content-Type application/javascript*
|
|
|
|
header Content-Type application/xhtml+xml*
|
|
|
|
header Content-Type application/atom+xml*
|
|
|
|
header Content-Type application/rss+xml*
|
2023-10-11 00:18:37 +03:00
|
|
|
header Content-Type application/wasm*
|
2021-03-30 03:47:19 +03:00
|
|
|
header Content-Type image/svg+xml*
|
|
|
|
}
|
|
|
|
}
|
2021-05-10 19:06:38 +03:00
|
|
|
|
2021-05-10 20:12:59 +03:00
|
|
|
# Long way with a block for each encoding
|
2021-05-10 19:06:38 +03:00
|
|
|
encode {
|
|
|
|
zstd
|
2021-05-10 20:12:59 +03:00
|
|
|
gzip 5
|
2021-05-10 19:06:38 +03:00
|
|
|
}
|
2021-03-30 03:47:19 +03:00
|
|
|
----------
|
|
|
|
{
|
|
|
|
"apps": {
|
|
|
|
"http": {
|
|
|
|
"servers": {
|
|
|
|
"srv0": {
|
|
|
|
"listen": [
|
|
|
|
":80"
|
|
|
|
],
|
|
|
|
"routes": [
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"encodings": {
|
|
|
|
"gzip": {},
|
|
|
|
"zstd": {}
|
|
|
|
},
|
|
|
|
"handler": "encode",
|
|
|
|
"match": {
|
|
|
|
"headers": {
|
|
|
|
"Content-Type": [
|
|
|
|
"text/*",
|
|
|
|
"application/json*",
|
|
|
|
"application/javascript*",
|
|
|
|
"application/xhtml+xml*",
|
|
|
|
"application/atom+xml*",
|
|
|
|
"application/rss+xml*",
|
2023-10-11 00:18:37 +03:00
|
|
|
"application/wasm*",
|
2021-03-30 03:47:19 +03:00
|
|
|
"image/svg+xml*"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"status_code": [
|
|
|
|
2,
|
|
|
|
4,
|
|
|
|
500
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"minimum_length": 256,
|
2021-05-10 19:06:38 +03:00
|
|
|
"prefer": [
|
|
|
|
"gzip",
|
|
|
|
"zstd"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"encodings": {
|
|
|
|
"gzip": {
|
|
|
|
"level": 5
|
|
|
|
},
|
|
|
|
"zstd": {}
|
|
|
|
},
|
|
|
|
"handler": "encode",
|
|
|
|
"prefer": [
|
2021-05-10 20:12:59 +03:00
|
|
|
"zstd",
|
|
|
|
"gzip"
|
2021-05-10 19:06:38 +03:00
|
|
|
]
|
2021-03-30 03:47:19 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|