Setting memcache keys in eval block

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


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;

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

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.


Markus Jelsma - Technisch Architect - Buyways BV
050-8536620 / 06-50258350

More information about the nginx mailing list