Setting memcache keys in eval block

Markus Jelsma markus at buyways.nl
Mon Feb 8 15:36:55 MSK 2010


Hello,


How can i set a memcache key using an arbitrary variable? It seems so 
straightforward but i cannot get it up and running. I try to fetch memcache 
results using eval, which i will then pass to memcache once again.


This works:
    set $memcached_key $cookie_token;
    memcached_pass     127.0.0.1:11211;

This doesn't work:
    set $cookie_token 'bla';
    set $memcached_key $cookie_token;
    memcached_pass     127.0.0.1:11211;


Both Memcached modules will complain that the memcached_key or memc_key 
variable was not set, this all happens inside an eval block, outside the eval 
block does work as expected . I'm using the latest 0.7 stable Nginx and tried 
both Memcached modules.



Regards,

Markus Jelsma - Technisch Architect - Buyways BV
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350




More information about the nginx mailing list