Issue 1424 - Latest flask-compress (1.6.0) breaks Dash#1426
Issue 1424 - Latest flask-compress (1.6.0) breaks Dash#1426Marc-Andre-Rivet merged 9 commits intodevfrom
Conversation
| # flask-compress==1.6.0 changed default to ['br', 'gzip'] | ||
| # and non-overridable default compression with Brotli is | ||
| # causing performance issues | ||
| self.server.config["COMPRESS_ALGORITHM"] = ["gzip"] |
There was a problem hiding this comment.
Hesitant to override the values for servers passed as parameter https://github.com/plotly/dash/pull/1426/files#diff-228c9aefac729977642672aa1416bacaR277 as modifying a passed argument's settings would be unexpected, but maybe we don't really have a choice here.
There was a problem hiding this comment.
Whenever we call Compress(self.server) we're effectively modifying the server's settings - and by default we do this even for user-provided servers. Perhaps we can check whether server.config["COMPRESS_ALGORITHM"] already has a value, and only set it if not?
There was a problem hiding this comment.
Turns out that running the code above against 1.5.0 fails and there is no __version__ or VERSION on flask_compress so determining the version needs to be done through pkg_resources. 01bfbcd
There was a problem hiding this comment.
Perhaps we can check whether server.config["COMPRESS_ALGORITHM"] already has a value, and only set it if not?
| @@ -1,5 +1,5 @@ | |||
| Flask>=1.0.2 | |||
| flask-compress==1.5.0 | |||
| flask-compress | |||
There was a problem hiding this comment.
unfix flask-compress
Fixes #1424
Proposes to override the default
COMPRESSION_ALGORITHMto['gzip']so as to avoid the costly, and currently non-configurable, Brotli compression.