unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.46k stars 692 forks source link

static-cache-paths and MIME type oddity #964

Open abathur opened 9 years ago

abathur commented 9 years ago

I'm not entirely sure if this indicates a bug or perhaps just a documentation hole of some sort, but the behavior was unanticipated and took me a little bit to figure out. I've been playing around with some of the caching settings locally, and incrementally pushing parts to a test server. I noticed today some cached & gzipped CSS assets being served with text/html content-type on the remote test server and text/css locally (they run slightly different configs by necessity)

The assets are added to the cache with load-file-in-cache-gzip and served on the route route = ^/static/(.*)$ cache:key=static/$1,name=static_gzip,mime=1,content_encoding=gzip,no_offload=true

The unexpected behavior is that setting static-cache-paths causes mime-types to be identified without mime-file being set.

unbit commented 9 years ago

--static-cache-paths has the flag UWSGI_OPT_MIME, so enabling it loads the default mime file.

I am not totally sure i understood your issue, so feel free to add more infos