Couple questions around compression in Pi-hole

Hello. Thanks for all the team's hard work on Pi-Hole. Long time user and patron.

My version(s):

On to my questions...

  1. Does the Web Interface deliver text based resources like javascript and css using compression algorithms like gzip or brotli? I'm not seeing it in DevTools but wanted to double check in case I'm missing something. Maybe it's dependent on a configuration (outside Pi-Hole?) in lighttpd. Just checking.
  2. When I click Update Gravity in the UI among the messages that are displayed I find is [i] Using libz compression. Not familiar with libz compression. Maybe that's meant to read zlib. In any case, would it be better to upgrade to brotli?

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

Thanks for the thorough and timely response! Much appreciated.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.