what's the difference between proxy_store and proxy_cache?

Maxim Dounin mdounin at mdounin.ru
Sun Nov 13 17:04:33 UTC 2011


On Sun, Nov 13, 2011 at 10:10:29AM -0500, zhenwei wrote:

> From Nginx official site there are two method to store remote upstream
> on local file system, "proxy_cache" and "proxy_store", the document
> describes clearly on how to configure, but still I have problem on the
> differences. Months ago I did some test over the both and found
> proxy_cache owns far better performance, and I thought proxy_cache is
> "cache in memory", recently after diving into source code, I recognized
> both are file based, so i'm not sure if it could afford high connection
> where disk probably becomes the bottleneck.

"proxy_cache" is general-purpose cache with automatic lookups 
before proxy_pass, expiration support and so on.  It is usually 
what you need if you need caching capabilities.

"proxy_store" is just a method to store proxied files on disk.  It 
may be used to construct cache-like setups (usually involving 
try_files and/or error_page-based fallback), though it's up to you 
to implement any required logic.

Maxim Dounin

More information about the nginx mailing list