Setting memcache keys in eval block

Marcus Clyne ngx.eugaia at
Thu Feb 11 07:05:47 MSK 2010

Markus Jelsma wrote:
> Thank you for your quick answer, although it is not quite a satisfaction to 
> read it's not possible at the moment.
> How can i stay up to date for such a feature if it were to be implemented in 
> the - hopefully nearby - future?
> I have another question, is my current solution really much slower than doing 
> it all in one location directive? I am now proxying the request the myself 
> where i can set the second eval block.
> I did perform some simple benchmarks but they aren't really alright since i 
> cannot really compare the situations but 2 http requests + 2 memcache requests 
> are quite slow in the end.
> Thanks.
>> No, it won't work. According to the current implementation, only one
>> eval block can take effect in a single location.
>> I must admit parallel eval blocks can be very useful and I believe
>> it should not be that hard to implement. But I have other missions to
>> do first atm ;)
>> Actually I want something much more general, that can be mixed with
>> other rewrite directives, like this:
>>     set $foo 'hi';
>>     set_capture_location $res '/foo';
>>     if ($res ~ 'xxx') { ... }
>>     set_capture_subrequest $res POST '/bar' 'body here';
>>     if ($res ~ 'xxx') { ... }
>>     ....
>> I'll ask Marcus Clyne if he has any plan to add support for such
>> things to his set_var submodule in his grand NDK project. Then an
>> ngx_capture module should be straightforward ;)
Yes, this currently isn't possible (AFAICT), because of how the 
http_rewrite_module's phase handler works, but it should be possible 
with easy modification of that, which will allow for recalling rewrites 
after subrequests.  I'm busy with other stuff right now, but I'll try to 
build the generic interface (if not the subrequest part) soon and 
include it in the first launched version of the NDK.


More information about the nginx mailing list