Couple questions around compression in Pi-hole

ad 1.)
No, not since Pi-hole FTL v5.9, Web v5.6 and Core v5.4 released.

This happened as lighttpd versions starting to ship with Debian Bullseye were dropping mod_compress support in favour of mod_deflate, which in turn would have required Pi-hole's installer code to cater for all sorts of variants and backports (see Optionally include lighttpd-mod-deflate since it is no longer provide… by lightswitch05 · Pull Request #4218 · pi-hole/pi-hole · GitHub ff. for details).

As Pi-hole's web UI is meant to be served locally and comparably light, the team decided to drop compression altogether and dedicate resources to fixing v5 issues and development of v6 instead.
Especially the latter weighed in here:
Compression is provided by a web server, not by Pi-hole itself.

Pi-hole v6 will drop the lighttpd web server as a dependency altogether, so you can deploy it with any webserver you want, configuring the webserver in any way you want (including compression). :wink:

ad 2.)

Pi-hole is using curl to download blocklists.

It would depend on the actual version shipping with a specific OS distribution and release whether a curl binary on a given system would have been compiled with support for specific compression features.

libz is one of the compression features potentially available with curl, as is brotli.

You can check whether curl supports those features on your system:

curl -V | grep "Features:.* libz\|brotli"

Pi-hole's gravity update employs curl to ask a web server to compress its files.
curl would then try to negotiate compression with the target webserver.
It would then depend on how a match of (de)compression options supported by curl and compression options as offered by a respective webserver would affect which compression would be actually used, or if it would result in a compressed download at all.

If both a web server of a blocklist maintainer and the curl package on the sytem requesting a blocklist would support brotli, a download could well use that method already.

How curl would actually determine which compression to favour in the presence of multiple compression features available would be a question for curl developers.

1 Like