[edit] uwsgi_store

syntax: uwsgi_store on|off|path

default: uwsgi_store off

context: http, server, location

This directive sets the path in which upstream files are stored. The parameter "on" preserves files in accordance with path specified in directives alias or root. The parameter "off" forbids storing. Furthermore, the name of the path can be clearly assigned with the aid of the line with the variables:

uwsgi_store   /data/www$original_uri;

The time of modification for the file will be set to the date of "Last-Modified" header in the response. To be able to safe files in this directory it is necessary that the path is under the directory with temporary files, given by directive uwsgi_temp_path for the data location.

This directive can be used for creating the local copies for dynamic output of the backend which is not very often changed, for example:

location /images/ {
  root                /data/www;
  error_page          404 = /fetch$uri;
}
 
location /fetch {
  internal;
 
  uwsgi_pass           backend;
  uwsgi_store          on;
  uwsgi_store_access   user:rw  group:rw  all:r;
  uwsgi_temp_path      /data/temp;
 
  alias               /data/www;
}

To be clear uwsgi_store is not a cache, it's rather mirror on demand.


Module: HttpUwsgiModule