Proxy_cache or direct static files ?

Maxim Dounin mdounin at
Mon Dec 16 11:41:25 UTC 2013


On Sun, Dec 15, 2013 at 05:01:25AM -0500, Larry wrote:

> Hello,
> I don't quite understand what I could get from caching with proxy_cache vs
> serving static files directly.
> Everywhere people tend to say that it is better to cache, but isn't caching
> the same as serving directly from static file ?
> Say that I serve home.html from a plain static html file, would I get any
> benefit to use reverse proxy + cache to serve it ?

Caching is useful when you have some resource which is costly to 
generate (e.g., dynamic pages or remote resources).  If you are 
serving static files which are already present on the same server,
in most cases there are no reasons to use cache.  In some rare 
cases it may be useful though, e.g., if you have some faster 
storage for cache.

Maxim Dounin

More information about the nginx mailing list