I made a simple test: $ ab -c 10 -n 10000 http://.... on localhost.
I am sure that the request is sent to uWSGI only once and is then
result: Requests per second: 3712.93 [#/sec] (mean)
Meanwhile, on the same machine and the same nginx for static file
reaches the result:
Requests per second: 4826.62 [#/sec] (mean)
How is that static files are faster to 30%! from the cache based on
static files ?
Cached response require additional reading of original response
headers, as well as calculating cache key and parsing the headers
in question (which may be an issue on cpu-bound servers). So I
would expect it to be somewhat slower than plain static files.
While 30% looks a bit too many, it certainly depens havily on
response sizes involved as well as type of a limiting factor (i.e.
cpu or disk bound). In worst case I would expect cache to be 2x
slower compared to static files (though it's unlikely to happen in