colour-science / flask-compress

Compress responses of your Flask application.
MIT License
117 stars 27 forks source link

Suggestion: min size to consider compression #38

Closed coderforlife closed 1 year ago

coderforlife commented 1 year ago

In a REST application, some endpoints may sometimes produce very small outputs (like just {}). These should not be compressed as it will add time and size. It would be nice if there was a configuration to set the minimum threshold, say 128 bytes, before compression will be attempted. NGINX has this option as gzip_min_length and it defaults to 20.

coderforlife commented 1 year ago

Nevermind, I missed it the first time I went through the config option: COMPRESS_MIN_SIZE.