atom feed8 messages in ru.sysoev.nginxRe: Setting cache parameters via if d...
FromSent OnAttachments
Jeff MitchellJan 27, 2011 9:07 pm 
Ryan MalayterJan 28, 2011 7:55 am 
Jeff MitchellJan 29, 2011 12:19 am 
Jeff MitchellJan 29, 2011 8:05 am 
Guzman BrasoJan 29, 2011 3:57 pm 
agentzhFeb 1, 2011 12:46 am 
agentzhFeb 1, 2011 12:53 am 
Ryan MalayterFeb 1, 2011 7:45 am 
Subject:Re: Setting cache parameters via if directives
From:agentzh (agen@gmail.com)
Date:Feb 1, 2011 12:53:26 am
List:ru.sysoev.nginx

On Tue, Feb 1, 2011 at 4:47 PM, agentzh <agen@gmail.com> wrote:

Consider the following config snippet:

   location /test {        set $a 3;        if ($a = 3) {            set $a 4;        }        echo $a;    }

GET /test will give you nothing for nginx 0.7.21 ~ 0.9.4.

Forgot to mention that we've been in favor of ngx_lua's set_by_lua and rewrite_by_lua directives to do something like this:

location /test { set $a 3; set_by_lua $a ' if ngx.var.a == "3" then return 4 end '; echo $a; }

and GET /test will give you the expected answer, "4" and the performance remains outstanding especially when you've enabled LuaJIT 2.0 ;)