Welcome! Log In Create A New Profile

Advanced

proxy_cache_bypass and cache refresh

Grzegorz Kulewski
October 03, 2014 05:44AM
Hello,

Is it true that a GET request that satisfies proxy_cache_bypass (and generates BYPASS cache status in the access log) should also refresh proxy cache for that URL?

There are several tutorials on the Internet that advise that it works. Also it was working for us before but stopped - either after nginx upgrade or after some configuration change - not sure right now. We are currently running nginx 1.4.7.

Parts of configuration:

http {
proxy_cache_path /var/cache/www levels=1:2 keys_zone=foo-cache:256m max_size=4g inactive=1h;
proxy_cache_key "$host$request_uri";
proxy_cache_lock on;
proxy_cache_lock_timeout 120s;
proxy_no_cache $upstream_http_x_bar_dont_cache_me $cookie_x_no_cache;
proxy_cache_bypass $http_x_bar_cache_refresh $cookie_x_bar_no_cache;
}

location = / {
proxy_pass http://foo_old_www;
proxy_cache foo-cache;
proxy_cache_valid 200 1h;
}


Request to refresh cache (I double checked that it generates a GET request and a cache status BYPASS):

curl -H 'X-Bar-Cache-Refresh: true' -D - 'http://www.foo.pl/'


Any idea why it doesn't work?

--
Grzegorz Kulewski

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

proxy_cache_bypass and cache refresh

Grzegorz Kulewski October 03, 2014 05:44AM

Re: proxy_cache_bypass and cache refresh

Grzegorz Kulewski October 10, 2014 11:16AM

Re: proxy_cache_bypass and cache refresh

Sergey Kandaurov October 13, 2014 03:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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