Skip to content

Commit 8e64fbe

Browse files
author
Marc-André Rivet
committed
Merge remote-tracking branch 'origin/dev'
# Conflicts: # .github/FUNDING.yml
2 parents dac71ae + 938c3ca commit 8e64fbe

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [1.16.3] - 2020-10-07
6+
### Fixed
7+
- [#1426](https://github.com/plotly/dash/pull/1426) Fix a regression caused by `flask-compress==1.6.0` causing performance degradation on server requests
8+
59
## [1.16.2] - 2020-09-25
610
### Fixed
711
- [#1415](https://github.com/plotly/dash/pull/1415) Fix a regression with some layouts callbacks involving dcc.Tabs, not yet loaded dash_table.DataTable and dcc.Graph to not be called

dash/dash.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import flask
2121
from flask_compress import Compress
2222
from werkzeug.debug.tbtools import get_current_traceback
23+
from pkg_resources import get_distribution, parse_version
2324

2425
import plotly
2526
import dash_renderer
@@ -49,6 +50,8 @@
4950
from . import _validate
5051
from . import _watch
5152

53+
_flask_compress_version = parse_version(get_distribution("flask-compress").version)
54+
5255
# Add explicit mapping for map files
5356
mimetypes.add_type("application/json", ".map", True)
5457

@@ -283,6 +286,16 @@ def __init__(
283286
else:
284287
raise ValueError("server must be a Flask app or a boolean")
285288

289+
if (
290+
self.server is not None
291+
and not hasattr(self.server.config, "COMPRESS_ALGORITHM")
292+
and _flask_compress_version >= parse_version("1.6.0")
293+
):
294+
# flask-compress==1.6.0 changed default to ['br', 'gzip']
295+
# and non-overridable default compression with Brotli is
296+
# causing performance issues
297+
self.server.config["COMPRESS_ALGORITHM"] = ["gzip"]
298+
286299
base_prefix, routes_prefix, requests_prefix = pathname_configs(
287300
url_base_pathname, routes_pathname_prefix, requests_pathname_prefix
288301
)

dash/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.16.2"
1+
__version__ = "1.16.3"

0 commit comments

Comments
 (0)