Proxy Cache - Check if file has been cached

I have implemented nginx with proxy cache successfully, however, I need
to have the ability to check if a certain file is already cached or
Is there a way to get a list of cached files?
Maybe another way will be to send a HEAD request which contains the file
URI to the proxy cache server to check if a file is already in cache?

Are these methods possible?

Posted at Nginx Forum:

Checking the header “Expires” is probably the most reliable way.



2010/12/30 digger18 [email protected]

I use this variable $upstream_cache_status added to my access log to
the Hit Percentage. While I think you can also use it to check whether
file is cached.
Add it to the log_format in you configure file, access every file you
to check, and the cache status will be shown in the access log.