Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gzip not work with v1.12 #33

Closed
blueloveTH opened this issue Jul 11, 2022 · 2 comments · Fixed by #36
Closed

gzip not work with v1.12 #33

blueloveTH opened this issue Jul 11, 2022 · 2 comments · Fixed by #36

Comments

@blueloveTH
Copy link

I am not sure what happened.
The gzip compress of my website works fine in v1.11.
However, in v1.12 all files are uncompressed.

My usecase is basic as follows, where my static files locate in /web directory.

app = Flask(__name__, static_folder='web', static_url_path='')

app.config['COMPRESS_MIMETYPES'] = ['text/html', 'text/css', 'text/xml', 
                                    'application/json',
                                    'application/javascript', 'font/ttf', 'font/otf', 'application/octet-stream']

Compress(app)
@alexprengere
Copy link
Collaborator

alexprengere commented Jul 11, 2022

I can reproduce, and I am pretty sure this is an unintended side effect of disabling the compression for streaming responses (see #30).
Unfortunately looking at the code, I am not sure if there is an easy way of saying "disable compression for streaming responses, unless the response is for static content", from the response object. I might be wrong, so I will ping @gilad9366 @raphaeljolivet who were active in the other discussion.

@cypres-it
Copy link

How about an option switch COMPRESS_STREAMS (default False) until this is solved?
This would help at least some people since not everyone actually needs streaming responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants