✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Suppress falsk_compress (Gzip)

Hi,

I have found using apache’s inbuilt gzip compression to be faster than using python’s inbuilt gzip which is called by flask_compress (details of how to use apache DEFLATE below).

My question is how can I turn flask_compress off?
It can be turned off by modifying the following line in dash.py:


Looking at the flask_compress documentation there is a key called ‘COMPRESS_LEVEL’ which can be set to zero within app. But I don’t know how to set this key???

To set-up apache’s gzip you need to add the following to your .conf file:
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip

Thanks,
Peter

Found the answer - when you start the app you can suppress compress by:

app = dash.Dash(__name__,  compress=False)