Welcome! Log In Create A New Profile

Advanced

Re: sent_http_HEADER Volatile under Nginx 1.2.4

Maxim Dounin
December 18, 2013 07:44AM
Hello!

On Mon, Dec 16, 2013 at 09:22:25AM +0000, Paul Taylor wrote:

> Yup, again, you’re right! I’ve moved the config around, so that I’m testing for any ‘true’ value in the proxy_no_cache & proxy_bypass_cache directives (removing the existing set_by_lua block).
>
> However, it’s still not behaving as I’d expect.
>
> In the following scenario (note comments):
>
> map $upstream_http_x_no_cache $no_cache_header {
> "" 0;
> default 1;
> }
>
> proxy_cache_bypass $no_cache_dirs $logged_in; # $no_cache_header;
> proxy_no_cache $no_cache_dirs $logged_in; # $no_cache_header;
>
> X-Cache-Status value is MISS, which is correct. Output of $no_cache_header is 1 (as set in the map).
>
> However, when adding back in the compare on $no_cache_header:
>
> proxy_cache_bypass $no_cache_dirs $logged_in $no_cache_header;
> proxy_no_cache $no_cache_dirs $logged_in $no_cache_header;
>
> X-Cache-Status value is still MISS, which is not correct, as it should be BYPASS. Output of $no_cache_header is 0.
>
> Unless I’m missing something, it still looks like touching the variable kills it?

The proxy_cache_bypass directive is expected to be checked before
a request is sent to a backend - it is to control whether a
request will be served from a cache or passed to a backend.

That is, what you see is actually expected behaviour - there are
no reasons X-Cache-Status to be BYPASS, and the cached
$no_cache_header value to be different from 0.

--
Maxim Dounin
http://nginx.org/

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

sent_http_HEADER Volatile under Nginx 1.2.4

ptylr December 12, 2013 02:22PM

Re: sent_http_HEADER Volatile under Nginx 1.2.4

Maxim Dounin December 12, 2013 02:34PM

Re: sent_http_HEADER Volatile under Nginx 1.2.4

ptylr December 12, 2013 06:38PM

Re: sent_http_HEADER Volatile under Nginx 1.2.4

Maxim Dounin December 13, 2013 01:30PM

Re: sent_http_HEADER Volatile under Nginx 1.2.4

Maxim Dounin December 18, 2013 07:44AM

Re: sent_http_HEADER Volatile under Nginx 1.2.4

Jonathan Matthews December 18, 2013 07:44AM

Re: sent_http_HEADER Volatile under Nginx 1.2.4

ptylr December 18, 2013 07:44AM

Re: sent_http_HEADER Volatile under Nginx 1.2.4

ptylr December 18, 2013 07:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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