Nginx proxy caching - how to check if it is working?

20,715

You can view headers with

  • the Firefox addon firebug
  • the Chrome debugging console
  • cURL (curl -I <address>)
  • ...
Share:
20,715

Related videos on Youtube

still.Learning
Author by

still.Learning

Updated on September 18, 2022

Comments

  • still.Learning
    still.Learning almost 2 years

    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!

  • user137717
    user137717 about 8 years
    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.
  • Christopher Perrin
    Christopher Perrin about 8 years
    That just means, that your browser isn't caching. It doesn't say anything about nginx