ngx.eugaia at gmail.com
Wed Dec 23 13:37:51 MSK 2009
> If you're actually worried about special characters in the parsed URI
> in $uri when feeding it as a memcached key, try Marcus Clyne's
> ngx_set_var module to pre-hash the key ;)
Thanks for the mention, but I wouldn't recommend hashing memcached keys
unless you absolutely have to. Apart from the (albeit slim) chance of
hash collisons (i.e. two URLs matching the same hash), it's a waste of
You should remember that the URLs will be passed URL-unencoded, though
(I believe - best to check that).
>> I've tried a few different combinations of location directives, but can't seem to get it right. For example:
>> If I made a request to:
>> I'd want to look up the following path in Memcached:
>> So, when I do that echo_async_location, I don't see how I'm able to extrapolate the path out.
> Use $uri rather than $request_uri. I know the difference between these
> two is very subtle, especially when not looking into the source. Blame
> Igor or some others ;)
>> If there was an internal variable that held the $uri, minus the $query_string, that would do it!
>> However, I don't think that exists at the moment.
> $uri is the parsed form of $request_uri, with query string excluded.
> And $request_uri is always the main request's URI while $uri is the
> current (sub)request's :)
Looks like I duplicated this info in my last email. :-) Oops.
More information about the nginx