In future this will be possible inside the UI, as happened for PHP config overrides, but for now unfortunately to achieve this you'll need to manually override your stack's Apache config and your site's config. Specifically the files you need to override are inside your compiled stack at:
apache_XYZ/conf/httpd.conf
- something like
apache_XYZ/conf/sites-enabled/yourdomainname.conf
I haven't tested enabling brotli or gzip compression in Indigo's Apache or Nginx, but would be keen for it to be supported, so will do what I can to help you get this up and running.
Focussing on Brotli, since it's the better of the two compression options:
In httpd.conf
you should enable this line, by removing its leading #
:
#LoadModule brotli_module lib/httpd/modules/mod_brotli.so
In your site config, you should add the IfModule mod_brotli.c
block:
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>
The result should look something like:
<VirtualHost *:50003>
DocumentRoot "/Users/indigo/Sites/test-site"
ServerName sitename.test
ErrorLog "/Users/indigo/.indigo/stacks/EY34F/apache_H8DE/log/sitename.test-error.log"
CustomLog "/Users/indigo/.indigo/stacks/EY34F/apache_H8DE/log/sitename.test-access.log" common
TransferLog "/Users/indigo/.indigo/stacks/EY34F/apache_H8DE/log/sitename.test-transfer.log"
Options Indexes FollowSymLinks
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:50002"
</FilesMatch>
<Directory "/Users/indigo/Sites/test-site">
AllowOverride All
Require all granted
</Directory>
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>
</VirtualHost>
Then rebuild your stack as per step c.
As mentioned, I haven't tried this myself, but will do. So if you'd rather wait till it's a little more proven, that's fine! Otherwise, let us know how you go!