Check if a resource is in the cache

Reinis Rozitis r at
Wed Oct 30 06:26:41 UTC 2019

> Hello,
> is there a way to check if a requested resource is in the cache?
> For example, “if” has the option “-f”, which could be used to check if a static
> file is present.
> Is there something similar for a cached resource?

Depending on what you want to achieve you could check $upstream_cache_status for  'HIT' ( )


More information about the nginx mailing list