Welcome! Log In Create A New Profile

Advanced

Simple question about proxy cache

J2R
March 17, 2013 05:18PM
I've used nginx as a reverse proxy server for a long while but I've not
tried out the proxy cache until today, and I have to say I'm a little
bit confused by what I'm seeing in the cache log, and I'm wondering
whether I've set things up correctly. My requirements are actually
pretty simple. I have a couple of locations which I want to proxy to
another server and cache the results. Thus:

location /media/house_images/{
proxy_pass http://backend;
proxy_cache one;
}

location /media/boat_images/{
proxy_pass http://backend;
proxy_cache one;
}


Apart from this, I don't want any cacheing of responses to be done. I am
assuming that the default is NOT to cache unless a cache zone is
specified (at the server or location level, presumably), so either
omitting a proxy_cache or specifying 'proxy_cache off' should be
sufficient to achieve this, should it not?

Two things are puzzling me, though. Firstly, in the cache log, I'm
seeing the URLs of all kinds of requests which SHOULD NOT be cached, and
I'm wondering whether all requests are logged whether they're cached or
not - I certainly hope this is the case and it's not actually cacheing
these responses. I would definitely prefer to only see entries in the
log for requests matching locations for which a cache has been
specified. I presume this is possible?

Secondly, the very requests which I would expect to be cached are all
showing up in the log with the word 'MISS' in the $upstream_cache_status
column.

So, I am worried that I'm currently cacheing everything EXCEPT the pages
I actually want to be cached!

Could someone please clarify whether my assumptions are correct, and
maybe explain how I should set up cacheing to do just what I want, in
the simplest way? Thanks.

John

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Simple question about proxy cache

J2R March 17, 2013 05:18PM

Re: Simple question about proxy cache

Maxim Dounin March 17, 2013 07:10PM

Re: Simple question about proxy cache

J2R March 18, 2013 07:22AM

Re: Simple question about proxy cache

J2R March 22, 2013 07:20AM

Re: Simple question about proxy cache

Maxim Dounin March 22, 2013 07:44AM

Re: Simple question about proxy cache

J2R March 22, 2013 07:40AM

Re: Simple question about proxy cache

J2R March 22, 2013 08:26AM

Re: Simple question about proxy cache

Maxim Dounin March 22, 2013 10:12AM

Re: Simple question about proxy cache

J2R March 22, 2013 11:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 77
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready