MCPcopy Index your code
hub / github.com/plotly/dash / enable_compression

Method enable_compression

dash/backends/_flask.py:355–371  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

353 )
354
355 def enable_compression(self) -> None:
356 try:
357 import flask_compress # pylint: disable=import-outside-toplevel
358
359 Compress = flask_compress.Compress
360 Compress(self.server)
361 _flask_compress_version = parse_version(
362 _get_distribution_version("flask_compress")
363 )
364 if not hasattr(
365 self.server.config, "COMPRESS_ALGORITHM"
366 ) and _flask_compress_version >= parse_version("1.6.0"):
367 self.server.config["COMPRESS_ALGORITHM"] = ["gzip"]
368 except ImportError as error:
369 raise ImportError(
370 "To use the compress option, you need to install dash[compress]"
371 ) from error
372
373
374class FlaskRequestAdapter(RequestAdapter):

Callers 1

init_appMethod · 0.45

Calls 1

parse_versionFunction · 0.90

Tested by

no test coverage detected