Search code examples
cachingsymfonynginxsymfony-2.1http-caching

How can I tell if nginx is caching responses with (shared) max age, public?


Is it possible to know whether the response I got, is new (I'm the first who made that request) or came out from the cache (someone else, or me, has already made that request and the cache is fresh).

I have access to everything, but I can't find where to see the hits/misses.

I can't see anything in the headers either, that indicate the age of the response (only the max age).

When I use Symfony2's AppCache instead of nginx cache, I can see an Age header. Should nginx be adding that header too?


Solution

  • I found this:

    add_header X-Cache $upstream_cache_status;
    

    Seems to work fine.