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 makes the response larger #18

Open
eldad87 opened this issue Oct 22, 2018 · 1 comment
Open

Gzip makes the response larger #18

eldad87 opened this issue Oct 22, 2018 · 1 comment

Comments

@eldad87
Copy link

eldad87 commented Oct 22, 2018

Hi,
I noticed that Gzip is applied to all requests. In some cases, we better off Gzip. For example, a very shot textual response with Gzip might get twice the size. For example:

Without encoding:

curl -i http://localhost:8000/ping
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Mon, 22 Oct 2018 16:37:12 GMT
Content-Length: 18

{"message":"pong"}

With encoding:

curl -H "Accept-Encoding: gzip" -i http://localhost:8000/ping 2>/dev/null --output -
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Type: application/json; charset=utf-8
Vary: Accept-Encoding
Date: Mon, 22 Oct 2018 16:39:07 GMT
Content-Length: 42

����V�M-.NLOU�R*��KW�����b`k�el

Please advise,
Thanks!

@eldad87 eldad87 changed the title Compression is making the response larger Gzip makes the response larger Oct 22, 2018
@stijndehaes
Copy link

In nginx for example you can set a response size before compression is even considered. Probably that would make sense for this as well?

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

2 participants