Force cache refresh
Ole Laursen
olau at iola.dk
Fri Jun 18 17:22:25 MSD 2010
> Igor Sysoev <igor at ...> writes:
> > You may bypass cache using "Some-Secret-Header: 1" in a request and
> > setting:
> > proxy_no_cache $http_some_secret_header;
> > The response may be cached.
Hm, I think I might have been too hasty there. I can't get it to
work with 0.7.67.
If I send a request with a special header that goes to proxy_no_cache,
then it always goes to the back-end as expected. But the response
isn't cached, at least if I send the same request without the
header, I get a back-end hit.
Configuration looks like this:
location / {
proxy_pass http://127.0.0.1:7000;
proxy_cache defaultzone;
proxy_cache_valid 200 302 30s;
proxy_cache_key "$request_uri";
proxy_no_cache $http_x_refresh_cache;
}
The cache is otherwise working fine, with two plain requests in a
row I only see the first one hit the back-end (I think this is what
fooled me first time).
Is this a bug?
Ole
More information about the nginx
mailing list