13

I have set up my nginx.conf file to use proxy caching from tutorials I have found online. Now I am trying to figure out how to check if it is actually working.

I've read somewhere that adding add_header X-Cache-Status $upstream_cache_status; to the config file in the server section should add a caching header to a response that will show if it was from cache (has values of either a HIT, MISS or EXPIRED).

I would like to know WHERE I can actually view this header (and its value) as well as if this is the right way/if there is another way. I'm very new to web technology in general so sorry if this is a noob question. Thanks!

7

You can view headers with

  • the Firefox addon firebug
  • the Chrome debugging console
  • cURL (curl -I <address>)
  • ...
2
  • I'm using nginx as a reverse proxy for my Node server so the headers say nginx in the chrome dev tools, but I'm seeing the GET 200 message show up in the console where I'm running the Node server. Does this mean nginx is not caching? I also checked the cache path and it's empty.
    – user137717
    May 14 '16 at 18:08
  • That just means, that your browser isn't caching. It doesn't say anything about nginx May 14 '16 at 18:18
-3

Use for example: http://nontroppo.org/tools/gziptest/ Enter your site url press "start testing". Sample output:

HTTP/1.1 200 OK
Server: nginx 
Date: Sat, 17 Jan 2015 18:44:25 GMT
Content-Type: text/html; charset=ISO-8859-1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.