9 messages in ru.sysoev.nginxRe: HTTP GEO Module and Memcached Mod...
FromSent OnAttachments
Liang JinApr 28, 2007 9:45 am 
Evan MillerApr 28, 2007 10:23 am 
Igor SysoevApr 28, 2007 11:42 am 
Liang JinApr 30, 2007 2:14 pm 
Evan MillerApr 30, 2007 10:45 pm 
Liang JinMay 1, 2007 11:41 am 
Evan MillerMay 1, 2007 10:00 pm 
Evan MillerMay 5, 2007 12:20 am 
Liang JinMay 5, 2007 2:47 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: HTTP GEO Module and Memcached Module questionActions...
From:Evan Miller (emmi@public.gmane.org)
Date:Apr 28, 2007 10:23:01 am
List:ru.sysoev.nginx

Liang Jin <mywebadmin@...> writes:

For example, if I set the key value in memcached in text format as "whatever", nginx can query and get the value and feed it back to the client browser. However, the question is: even if the text is valid HTML, the browser still thinks it is data, not web pages, so it offers me to download. I guess I need to set extra headers before the HTML in order to make it work, but I cannot find any information on this.

I ran into this same problem (being that Memcache just serves up data and won't tell Nginx what type of data it is). I think the best solution is to set the "default_type" in your configuration based on which key it's getting, e.g.,

location /html { memcached_pass 127.0.0.1:11211; default_type text/html; }

location /javascript { memcached_pass 127.0.0.1:11211; default_type text/javascript; }

Should work for most uses.

Evan

Thanks.