We have a Spring Boot 3 (3.1.1) application with an Angular frontend. By setting the following properties, the static files (e.g. main.js) are delivered compressed with gzip:
server.compression.enabled=true
server.compression.min-response-size=4096
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,application/font-sfnt,application/font-woff,application/font-woff2
Is it possible to set brotli as the default compression algorithm for on-the-fly compression?
By creating compressed files (gzip and brotli) during compilation, the embedded tomcat delivers the brotli-compressed file. As we do not want to create those compressed files during compilation, we are looking for a way to ensure that the embedded tomcat in the Spring Boot 3 application compresses the files on the fly. But we haven't found a way yet to do so using brotli.
We also do not want to put our application behind a proxy as suggested in How to use Brotli compression in Spring Boot?