Welcome! Log In Create A New Profile

Advanced

Re: Cache by mime type

Francis Daly
July 22, 2012 02:14PM
On Sun, Jul 22, 2012 at 05:27:44AM -0400, burn wrote:

Hi there,

> Thanks, that seems to work. But I still don't quite understand how. I
> did use both directives with the same variable. Now when I set
> "proxy_cache_bypass 0;", it seems to correctly cache images and serve
> that cache.

proxy_cache_bypass is "shall I serve this from upstream, even if I
already have a valid cached version". Setting it to 0 (or empty) means
that everything that is valid in the cache, will be served from the cache.

Strictly, it shouldn't be used in this case at all. But it is needed
to hush the warning that is presumably due to the bug mentioned in
http://mailman.nginx.org/pipermail/nginx/2011-March/025557.html

(I think that that bug was fixed in 1.0.3; possibly the warning is no
longer needed?)

And now you are using proxy_cache_bypass without an identical
proxy_no_cache -- although you're not actually caring about the
proxy_cache_bypass part, so maybe you won't have the problems referred to.

> I'd imagine that unconditional 0 in that directive would
> cause nothing being served from cache ever (as that variable is
> considered first).

No, unconditional 0 there means "serve from cache if possible", and is
equivalent to the line being omitted.

proxy_no_cache is about "shall I actually save this response into the
cache, even though all other indications are that I should do so". That's
the one that you want to be "no, don't" for all of the mime types that
you don't want cached.

All the best,

f
--
Francis Daly francis@daoine.org

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

Cache by mime type

burn July 20, 2012 09:57AM

Re: Cache by mime type

Denis F. Latypoff July 20, 2012 10:04AM

Re: Cache by mime type

burn July 20, 2012 01:47PM

Re: Cache by mime type

Valentin V. Bartenev July 20, 2012 02:00PM

Re: Cache by mime type

burn July 20, 2012 02:23PM

Re: Cache by mime type

Valentin V. Bartenev July 20, 2012 02:32PM

Re: Cache by mime type

burn July 20, 2012 02:45PM

Re: Cache by mime type

Valentin V. Bartenev July 20, 2012 02:52PM

Re: Cache by mime type

burn July 20, 2012 03:05PM

Re: Cache by mime type

Francis Daly July 22, 2012 04:10AM

Re: Cache by mime type

burn July 22, 2012 05:27AM

Re: Cache by mime type

Francis Daly July 22, 2012 02:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 312
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready