When dealing with static files, encoding them beforehand saves server resources since they’re only encoded once, and before they are needed.
Brotli and zstd are great algorithms to pre compress in for text compression.
In caddy you could enable pre compressed files with the precompressed
option, see caddy text compression for more details.