django-compression-middleware
django-compression-middleware copied to clipboard
Changing Brotli Compression Level
Is there a way to change the brotli compression level?
At the moment it is hard-coded to a fixed value (4). I've found this to give pretty good benefit for the cost. Maybe you had a different use-case in mind?
I was planning to compress 80megabytes of data and sacrifice a few megabytes to gain speed from compression, it gets compressed to 7 megabytes but takes some time to compress.
That is indeed an interesting case. Is this a streaming response? If we know the size beforehand, we could increase the compression level. In the streaming case, we don't know the size, so can't use such a simple heuristic.
No, I want to decrease the compression level to gain speed from compression, my cpu struggles from compression but the bandwidth is ok with that.