2021-03-30 08:47:19 +08:00
|
|
|
:80
|
|
|
|
|
2021-05-11 00:06:38 +08:00
|
|
|
# All the options
|
2021-03-30 08:47:19 +08: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*
|
|
|
|
header Content-Type image/svg+xml*
|
|
|
|
}
|
|
|
|
}
|
2021-05-11 00:06:38 +08:00
|
|
|
|
2021-05-11 01:12:59 +08:00
|
|
|
# Long way with a block for each encoding
|
2021-05-11 00:06:38 +08:00
|
|
|
encode {
|
|
|
|
zstd
|
2021-05-11 01:12:59 +08:00
|
|
|
gzip 5
|
2021-05-11 00:06:38 +08:00
|
|
|
}
|
2021-03-30 08:47:19 +08: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*",
|
|
|
|
"image/svg+xml*"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"status_code": [
|
|
|
|
2,
|
|
|
|
4,
|
|
|
|
500
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"minimum_length": 256,
|
2021-05-11 00:06:38 +08:00
|
|
|
"prefer": [
|
|
|
|
"gzip",
|
|
|
|
"zstd"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"encodings": {
|
|
|
|
"gzip": {
|
|
|
|
"level": 5
|
|
|
|
},
|
|
|
|
"zstd": {}
|
|
|
|
},
|
|
|
|
"handler": "encode",
|
|
|
|
"prefer": [
|
2021-05-11 01:12:59 +08:00
|
|
|
"zstd",
|
|
|
|
"gzip"
|
2021-05-11 00:06:38 +08:00
|
|
|
]
|
2021-03-30 08:47:19 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|