Slow data access can be improved drastically using a layer of caching. Caching temporarily saves recently used information in a store optimized for information lookup. This improves the server's performance by reducing the number of lookups required to load the same resource multiple times.
NGINX can cache static as well as dynamic content. If used in front of an upstream, NGINX will cache the responses received, thus doing away with future requests to the upstream server. In this chapter, we will cover the following topics:
Caching static content
Using FastCGI and the related cache
Using Proxy and the related cache
Using Memcache