From 77764714ad83d5c6e4db2da4b8945701f146bad0 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Mon, 10 May 2021 12:06:38 -0400 Subject: encode: Default to order the formats are enabled for `prefer` in Caddyfile (#4151) --- .../integration/caddyfile_adapt/encode_options.txt | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'caddytest/integration/caddyfile_adapt') diff --git a/caddytest/integration/caddyfile_adapt/encode_options.txt b/caddytest/integration/caddyfile_adapt/encode_options.txt index a43c7e0..9459008 100644 --- a/caddytest/integration/caddyfile_adapt/encode_options.txt +++ b/caddytest/integration/caddyfile_adapt/encode_options.txt @@ -1,5 +1,6 @@ :80 +# All the options encode gzip zstd { minimum_length 256 prefer zstd gzip @@ -14,6 +15,20 @@ encode gzip zstd { header Content-Type image/svg+xml* } } + +# Prefer list is implied (short way) +encode gzip zstd + +# Prefer list is implied (long way) +encode { + gzip 5 + zstd +} + +# Prefer list is turned off +encode gzip zstd { + prefer off +} ---------- { "apps": { @@ -55,6 +70,37 @@ encode gzip zstd { "zstd", "gzip" ] + }, + { + "encodings": { + "gzip": {}, + "zstd": {} + }, + "handler": "encode", + "prefer": [ + "gzip", + "zstd" + ] + }, + { + "encodings": { + "gzip": { + "level": 5 + }, + "zstd": {} + }, + "handler": "encode", + "prefer": [ + "gzip", + "zstd" + ] + }, + { + "encodings": { + "gzip": {}, + "zstd": {} + }, + "handler": "encode" } ] } -- cgit v1.2.3