3 messages in ru.sysoev.nginxRe: Changing sources: Memcached modul...
FromSent OnAttachments
matamourosJun 17, 2009 8:35 am 
Michał JaszczykJun 17, 2009 12:04 pm 
matamourosJun 18, 2009 3:53 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Changing sources: Memcached module variantActions...
From:Michał Jaszczyk (jasi@gmail.com)
Date:Jun 17, 2009 12:04:52 pm
List:ru.sysoev.nginx

On Wednesday 17 June 2009 17:35:43 matamouros wrote:

Hi everyone,

I'm having a hard time going through the sources of the memcached module, finding the thread of things. I need to do a small change in this module's behaviour, namely setting a URL in a var that will be accessible in config so that I can use that var to proxy a request for the real content. So, instead of sending a cache hit's content directly to the user, I want the memcached module to populate a URL in a variable that will be picked up by the next line in the config in order to proxy a request to it, and only then serve it's content to the user.

Right now the memcached module's current behaviour makes sense for caching html and images. In my case I need to have a map for URLs like this:

key = URL sent by client value = masked URL for which we will get the content and proxy it

I don't really want to sound like a pussy or anything - I know my way around C - but I'm finding it hard to know where to start... The things I need are disable the response build and sending to the user after there is a cache hit, and instead populate a variable that will be accessible in config space. The proxy module should take care of things from there on. I probably need to break something in ngx_http_memcached_pass, and I have no freaking clue on how to set up a variable for config space.

Please, any help from the more experienced guys? Thank you.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3013,3013#msg-3013

Hey,

You may want to try 3rd party module named "eval" created by Valery Kholodkov. See http://github.com/vkholodkov/nginx-eval-module/tree/master .

Cheers,