On 13/06/15 07:45, Davide Setti wrote:
Hello,

I'm trying to configure uWSGI [uWSGI 2.0.10 (64bit)] to gzip the content
of a Django website. It works for contents generated by Django, but it
doesn't for static files (using --static-map).

I know that it's possible to generate *gz at build time and let uwsgi
serve them, but we're using cloudfront with far expire headers. Static
resources are only asked once from Cloudfront and I'd like to avoid
adding complexity to the build step.

Will cloud front make the request claiming support for gzip? If so, it should take care of the rest, surely? Specifically, serving it uncompressed for those clients that don't support it.

If not, they should pass through the two forms of request... worth asking them about, IMHO.

A simple configuration to test the issue:

uwsgi --http :8000 --static-map=/static=/tmp/
--response-route-if='contains:${HTTP_ACCEPT_ENCODING};gzip gzip:'

Is this a known issue? Is there a workaround?

My understanding is the static-map is normally handed off to offload threads [you have them configured, right?] so they don't take part in the normal response routing any more, but also don't consume an app worker thread/process.

--
C
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to