Skip to content

Commit 8507f65

Browse files
authored
🔧 allow gzip to be set via env (#1133)
* 🔧 allow gzip to be set via env * 📝 update changelog
1 parent 8ee3588 commit 8507f65

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
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](http://semver.org/).
44

5+
## [Unreleased]
6+
### Added
7+
- [#1133](github.com/plotly/dash/pull/1133) Allow the `compress` config variable to be set with an environment variable with DASH_COMPRESS=FALSE
8+
59
## [1.9.0] - 2020-02-04
610
### Fixed
711
- [#1080](https://github.com/plotly/dash/pull/1080) Handle case where dash fails to load when used inside an iframe with a sandbox attribute that only has allow-scripts

dash/_configs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ def load_dash_env_vars():
2929
'DASH_HOT_RELOAD_MAX_RETRY',
3030
'DASH_SILENCE_ROUTES_LOGGING',
3131
'DASH_PRUNE_ERRORS',
32+
'DASH_COMPRESS'
3233
)
3334
}
3435
)
3536

3637

37-
DASH_ENV_VARS = load_dash_env_vars()
38+
DASH_ENV_VARS = load_dash_env_vars() # used in tests
3839

3940

4041
def get_combined_config(name, val, default=None):

dash/dash.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def __init__(
221221
requests_pathname_prefix=None,
222222
routes_pathname_prefix=None,
223223
serve_locally=True,
224-
compress=True,
224+
compress=None,
225225
meta_tags=None,
226226
index_string=_default_index,
227227
external_scripts=None,
@@ -276,7 +276,9 @@ def __init__(
276276
routes_pathname_prefix=routes_prefix,
277277
requests_pathname_prefix=requests_prefix,
278278
serve_locally=serve_locally,
279-
compress=compress,
279+
compress=get_combined_config(
280+
"compress", compress, True
281+
),
280282
meta_tags=meta_tags or [],
281283
external_scripts=external_scripts or [],
282284
external_stylesheets=external_stylesheets or [],

0 commit comments

Comments
 (0)