Hello!
On Tue, Nov 13, 2012 at 6:08 AM, Justin wrote:
> if memcache key include "/" or "=" such as.
>
> it'll be changed to %2f,
>
> how to use lua to resolve it?
>
> I tried "[[...]]" , but "/" will to be changed to %2f too
>
By default, lua-resty-memcached uses ngx.escape_uri [1] to escape
special characters in the user keys, just as the standard
ngx_memcached module [2]. You can, however, disable this behavior by
specifying the "key_transform" option in the new() method call, as in
the following example:
local memcached = require "resty.memcached"
local function id(key)
return key
end
local memc, err = memached:new{
key_transform = { id, id }
}
You can surely specify other escaping and unescaping routines made by yourself.
Please check out the official documentation for details:
https://github.com/agentzh/lua-resty-memcached#new
BTW, I'm cc'ing the openresyt-en mailing list. And you're very welcome
to join there as well: https://groups.google.com/group/openresty-en
Best regards,
-agentzh
[1] http://wiki.nginx.org/HttpLuaModule#ngx.escape_uri
[2] http://wiki.nginx.org/HttpMemcachedModule