[uWSGI] Flat file caching in subdirectories

Tim van der Linden tim at shisaa.jp
Tue Jul 12 15:13:03 CEST 2016

On Tue, 12 Jul 2016 19:19:45 +0900
Tim van der Linden <tim at shisaa.jp> wrote:

Hi Roberto

I have it in production now for testing and it seems to hold up well.

One "bug" I noticed is the fact that headers get stripped. If uWSGI serves the full request (does not pull it from cache) the headers look fine:

- Connection keep-alive
- Content-Encoding gzip
- Content-Type	text/html; charset=utf-8
- Date Tue, 12 Jul 2016 12:57:54 GMT
- Server nginx/1.6.2
- Transfer-Encoding: chunked
- Vary: Accept-Encoding

However, if the same page gets cached and served via "static:" headers get stripped:

- Connection: keep-alive
- Content-Length: 27301
- Date: Tue, 12 Jul 2016 12:58:02 GMT
- Last-Modified: Tue, 12 Jul 2016 11:11:09 GMT
- Server nginx/1.6.2

The Gzip header is gone and more importantly the "Content-Type" header is gone which can cause issues in some browsers. This happens with this route declaration:

route-if = isfreshfile:/disk1/uwsgi_cache${PATH_INFO}file.html,2628000 static:/disk1/uwsgi_cache${PATH_INFO}file.html

Can it be that there is a problem with "static:" in uWSGI? Or am I doing something wrong in the "uwsgi-router-isfreshfile" plugin which strips headers?

For now I have set Nginx to force this header after uWSGI is finished ... but that is just a hack.


More information about the uWSGI mailing list