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

configure connexion to gzip its responses? #620

Closed
drafter250 opened this issue Jul 10, 2018 · 3 comments
Closed

configure connexion to gzip its responses? #620

drafter250 opened this issue Jul 10, 2018 · 3 comments

Comments

@drafter250
Copy link

Description

I have a client that expects all api responses to be gzipped.

simply adding "Content-Encoding": "gzip" to response headers doesn't actually signal flask or connexion to gzip the response.

apparently this is usually left up to the production webserver like nginx.

I also tried installing flask-compress to modify the app instance to gzip it's responses automatically. but got various errors about missing attributes.

Expected behaviour

For Testing is there a relatively simple way to get connexion to gzip its responses?

Actual behaviour

Steps to reproduce

Additional info:

Output of the commands:

  • python --version 3.6.5
  • pip show connexion | grep "^Version\:"
@jmcs
Copy link
Contributor

jmcs commented Jul 11, 2018

Can you post a snippet on how you tried to use flask-compress? Please note that for flask extensions you need usually need to use app.app since they expect a Flask App not a Connexion one.

@dtkav
Copy link
Collaborator

dtkav commented Sep 20, 2018

apparently this is usually left up to the production webserver like nginx.

Yup!
If you are deploying a connexion app to production, you will want to use a production webserver like nginx anyway - the built-in flask webserver is for development only!.
If you want to test gzip (or other nginx features) I'd recommend doing this in an integration test against your packaged (app + nginx/gunicorn).
I don't recommend trying to add this features to the development server.

@dtkav
Copy link
Collaborator

dtkav commented Sep 27, 2018

Hey @drafter250 , I'm going to close out this ticket. Please re-open if you have more to add!

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

No branches or pull requests

3 participants