Both references you provide are examples of nginx
's caching functionality.
They both behave roughly the same but are used for different scenarios:
- The
proxy_cache
directives are used when the application (generally speaking the backend) is accessed through HTTP (i.e. when nginx
serves as a [reverse] proxy for another web server).
- The
uwsgi_cache
directives are used when the application is hosted by an instance that uses the uwsgi
protocol (for example the uWSGI
application stack).
The directives available for each of the two methods behave very similar if not equally (this - of course - is intended behaviour).
nginx
also offers similar functionality for e.g. FastCGI backends.
Since your setup uses uwsgi
, you would rather use the corresponding uwsgi_cache
directives.
Actually, you have to do so unless you want to introduce a second HTTP-based (web) server to serve your Python app behind your nginx
instance.