brotli icon indicating copy to clipboard operation
brotli copied to clipboard

Feature request: HTTPCompressorWithLevels

Open klondikedragon opened this issue 1 year ago • 2 comments

HTTPCompressor is very handy to automatically do the right thing based on what encodings the client can accept.

However, it assumes that default compression levels should be used. In a CPU-constrained environment, it can be desirable to customize the compression levels.

HTTPCompressorWithLevels could be func HTTPCompressorWithLevels(w http.ResponseWriter, r *http.Request, brotliLevel, gzipLevel int) io.WriteCloser ... and then HTTPCompressor becomes a wrapper around that. Are you open to the idea if I submit a PR to add this?

klondikedragon avatar Dec 06 '24 04:12 klondikedragon

Yes, I think that would be a good idea.

andybalholm avatar Dec 06 '24 17:12 andybalholm

@andybalholm PR submitted, see what you think. Thanks!

klondikedragon avatar Dec 07 '24 06:12 klondikedragon

I finally got around to doing this.

andybalholm avatar Aug 21 '25 18:08 andybalholm