# Cache hit statistics?

**URL:** <https://www.ruby-forum.com/t/cache-hit-statistics/219066>\
**Category:** NGINX\
**Created:** [April 19, 2012, 9:11pm UTC](https://www.ruby-forum.com/t/cache-hit-statistics/219066 "2012-04-19T21:11:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [April 19, 2012, 9:11pm UTC](https://www.ruby-forum.com/t/cache-hit-statistics/219066/1 "2012-04-19T21:11:14Z")

</div>

Does nginx have a cache hit ratio statistic… Ive been searching … or  
perhaps a way to differentiate in the logs wchi was served from cache  
and which was not. Thanks

-Mike

---

<div class="post-metadata">

**Author:** ![Micheal\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@Micheal\_W](https://www.ruby-forum.com/u/Micheal_W)\
**Post date:** [April 20, 2012, 3:15pm UTC](https://www.ruby-forum.com/t/cache-hit-statistics/219066/2 "2012-04-20T15:15:35Z")

</div>

Hello!

On Thu, Apr 19, 2012 at 07:10:45PM +0000, Micheal W. wrote:

> Does nginx have a cache hit ratio statistic… Ive been  
> searching .. or perhaps a way to differentiate in the logs wchi  
> was served from cache and which was not. Thanks

The $upstream\_cache\_status variable is what you are looking for.  
It’s not yet described in docs, but here is a wiki entry:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Maxim D.
