Le 10/03/2023 à 16:41, Marcus MERIGHI a écrit :
Hello,
j...@carnat.net (Joel Carnat), 2023.03.10 (Fri) 02:31 (CET):
I just tried applying gzip compression on a simple test web site using httpd
and the gzip-static option ; using OpenBSD 7.2/amd64.
As I understood the man page, gzip-static is supposed to be used inside the
server block ; like listen, errdocs or tls. But doing so does not seem to
enable gzip compression for files defined in a location block.
You have to provide the .gz file manually.
httpd(8) does not create the gzip file content on the fly.
This thread:
https://marc.info/?t=163603231000004
from when the feature was added, starts with the OP saying:
In other words, if a client support gzip compression, when
"file" is requested, httpd will check if "file.gz" is avaiable
to serve.
Well, the .gz file does exist.
And I can switch from working state to non-working state by just moving
the gzip-static option from inside the location section to outside of it
(still inside the server section).
Also, from httpd.conf(5):
Enable static gzip compression to save bandwidth.
If gzip encoding is accepted and if the requested file exists
with an additional .gz suffix, use the compressed file instead
and deliver it with content encoding gzip.
Marcus