Using encode directive in CaddyFile with any value (zstd, gzip, br tested) brokes (even disappears) 103 Early Hints in the Caddy response.
I expect 103 Header and gzip/br/zstd-compressed 200 response together, but catch only 200 with encode OR 103+200 uncompressed.
2. Error messages and/or full log output:
no related errors
3. Caddy version:
FrankenPHP v1.1.0 PHP 8.3.3 Caddy v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
(but clear Caddy v2.7.6 without FrankenPHP has same behavior!)
4. How I installed and ran Caddy:
download binary , or over xcaddy, same effect
a. System environment:
ubuntu 22.04 lts x64
d. My complete Caddy config:
host.ltd {
encode gzip #or zstd or br or together
header +Link "</assets/tmpl/images/back-first-screen-1920-v6.png>; rel=preload; as=image"
respond 103 # or set up Link header via PHP and headers_send(103); with FrankenPHP
file_server # or php_server
}
i tested with match and also no 103 response:
...
encode {
gzip 3
#match status 2xx
#match status 200
match {
header Content-Type text/*
}
}
...
I can catch 103 Early Hints header only when remove or comment encode directive in CaddyFile.
Here is my tests with Chrome v122 chrome://net-export/ and visualize with https://netlog-viewer.appspot.com/:
Not working 103 with encode enabled. Here is first response and it is 200:
As a handmade crutch, i found temporary solution how to get 103 Header and gzip compressed 200 response together: with compress my output via PHP… but i want use on-the-fly compression via Caddy which must working ok, or maybe somewhere my mistake?
I builded xcaddy build fix-6144
and caddy -v prints v2.7.6-0.20240306201431-830307323e04 h1:yErhQd88gKwaq5PF3cF7Xd9fJTSySkStI4iXT7pV2/s=
…and then i make new tests (only with manual respond 103 in Caddyfile) with same result: status 103 disappears when compression (only gzip tested in this time) enabled.