Support brotli in addition to gzip for output compression

Description

Brotli compression is considered the new default standard replacing gzip, it's faster and compresses better
https://medium.com/oyotech/how-brotli-compression-gave-us-37-latency-improvement-14d41e50fee4

Apache Commons Compress includes it
https://commons.apache.org/proper/commons-compress/

Lucee uses an old version of this library, 1.9.0 the latest version includes a lot of bug fixes and several security fixes https://archive.apache.org/dist/commons/compress/RELEASE-NOTES.txt

It bundles the Google implementation which includes a BrotliOutputStream
https://github.com/google/brotli/blob/master/java/org/brotli/wrapper/enc/BrotliOutputStream.java

https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/lucee/runtime/writer/CFMLWriterImpl.java#L408

I'm not sure if Lucee's implementation already does this, but it would be good to consider checking the content type of whatever is being encoded and to skip compressing compressed archives, images, video and sound files as usually it's a complete waste of CPU and effort

Status

Assignee

Unassigned

Reporter

Zac Spitzer

Affects versions

5.3.5.13

Priority

New
Configure