Setting memcache keys in eval block

Valery Kholodkov valery+nginxen at grid.net.ru
Sun Feb 14 18:31:07 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 just have pushed a change to nginx eval module which allows multiple 
eval blocks in one location:

http://github.com/vkholodkov/nginx-eval-module/tree/bba2d53fc1d8f118fb79424250db8c9e832b66c1

Hope this helps!

> 
> 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 ;)

-- 
Best regards,
Valery Kholodkov



More information about the nginx mailing list