Welcome! Log In Create A New Profile

Advanced

proxy_cache_valid inheritance

Jérôme Loyet
June 18, 2010 06:32PM
Hi,

I have a question about the proxy_cache_valid inheritance. I have the
following configuration:

http {
...
proxy_cache_valid 301 1h;
proxy_cache_valid 200 302 404 10m;
proxy_cache_valid any 1m;
...
server {
proxy_cache mycache;

location /test {
proxy_pass http://$backend;
}

location /bar {
proxy_pass http://$backend;
proxy_cache_valid 5m;
}

location /foo {
proxy_pass http://$backend;
proxy_cache_valid 200, 301, 302, 404 5m;
}
}
}

In this conf:

- /test will be cache with 1h for 301, 10m for 200/302/404 and 1m for
the other types of response

How will be cahed requests to /foo ?
- 200, 301, 302 = 5m, others won't be cached ?
- 200, 301, 302 = 5m, 404 = 10m (as set in http{}) and others will be
cached for 1m (as set in http{}) ?

How will be cahed requests to /bar ?
- 200, 301, 302, 404 = 5m, others won't be cached ?
- 200, 301, 302, 404 = 5m, others will be cached for 1m (as set in http{}) ?

I don't know if setting proxy_cache_valid in location{} will totaly
overwritten proxy_cache_valid from http{} or just overwritten
specified values ?

Thx a lot
++ Jerome

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

proxy_cache_valid inheritance

Jérôme Loyet June 18, 2010 06:32PM

Re: proxy_cache_valid inheritance

Piotr Sikora June 18, 2010 07:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
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