upstream_cache_status for proxy_store

Maxim Dounin mdounin at
Thu May 10 09:07:23 UTC 2012


On Wed, May 09, 2012 at 08:57:51PM +0800, 杨镭 wrote:

> Hi all:
> The $upstream_cache_status variable can be used to log cache HIT/MISS. But
> I found it's only working with proxy_cache.
> Although, proxy_cahe is much advanced than proxy_store, we've to use the
> latter one.
> Is there any alternative to log the same info?

With proxy_store status will be always "MISS", as it doesn't 
return anything cached, it just stores a response got from 
upstream.  If you use proxy_store with error_page/try_files 
fallback to emulate cache, you may use e.g. distinct logging to 
obtain information whether a static file was served or there was 
upstream request.

Maxim Dounin

More information about the nginx mailing list