Closed AliveDevil closed 3 weeks ago
Sorry I'm confused, that is happening? You're requesting a file and gunicorn is unpacking the files? It should always just "serve" them from my point of view. I'm using gunicorn behind a caddy server so I'm not really into header handling of gunicorn neither.
Exactly that is happening.
gunicorn serves the gzip compressed files by sending them uncompressed over the wire.
Just wanted to make you aware of that. In the end I put nginx in front and serve static files through that now.
~~Maybe related to this: https://github.com/benoitc/gunicorn/issues/2875~~
Gunicorn is no longer used, can this be closed?
Not relevant anymore.
It looks like gunicorn/Flask automatically decompresses .gz-files (if the user-agent isn't specifying
Accept-Encoding: Identity
).Wrong behavior:
Expected behavior:
On
Accept: */*
gunicorn/Flask automatically decompresses the static file on the filesystem, which results in wasted bandwidth (compare missing Content-Length, Content-Encoding, and added Transfer-Encoding). This does add strain on the ASU server, which now has to decompress that file inflight.This behavior is observed with:
Behavior, as expected, is observed with:
curl -H "Accept-Encoding: identity"
I unfortunately don't have any experience using gunicorn/flask, so I don't have anything more to add here.