To enable Brotli in Apache2 is very simple
Step 1 - Install
apt-get install brotli
Step 2 - edit your custom template file .tpl and .stpl files / copy and edit new so kept after update.
/usr/local/hestia/data/templates/web/apache2/
add something like the below (depending on what extension you want to compress with Brotli
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>
under the last and save
</IfModule>
Enable in Apache2
a2enmod brotli
then
systemctl restart apache2
You can test if it worked here
Brotli Test - Verify Brotli Compression Support | KeyCDN Tools
or check heqaders
HTTP Header Checker - Check HTTP Response Headers With curl | KeyCDN Tools
You will get something like below
HTTP/2
200
server: nginx
date: Sun, 24 Oct 2021 04:11:37 GMT
content-type: text/html; charset=utf-8
content-length: 1005
last-modified: Sun, 24 Oct 2021 01:54:31 GMT
cache-control: max-age=86400, proxy-revalidate
expires: Mon, 25 Oct 2021 04:11:37 GMT
vary: Accept-Encoding,User-Agent
content-encoding: br
strict-transport-security: max-age=15768000;
accept-ranges: bytes
As always try at your own risk. This was tested on a fresh Deb 10 install