Once Nginx is set up as a reverse proxy, it's logical to turn it into a caching proxy. Fortunately, this can be achieved very easily with Nginx.
Before you can enable caching for a certain location, you need to configure a cache. A cache is a filesystem directory containing files with cached items and a shared memory segment where information about cached items is stored.
A cache can be declared using the
proxy_cache_path <path> keys_zone=<name>:<size> [other parameters...];
The preceding command declares a cache rooted at the path
<path> with a shared memory segment named
<name> of the size
This directive has to be specified in the
http section of the configuration. Each instance of the ...