Thanks for the reply!
Yep, I guessed the ngx_memc module will encode the memcached keys.
I decoded the key url initially as "...excludes=n_Bronze,n_genderID,n_Silver..." before ngx.location.capture
And in location /memc-set, the memc_key should be the same as "...excludes=n_Bronze,n_genderID,n_Silver..." since it was encoded then decoded, but I found the key in memcached still holds "...excludes=n_Bronze,n_genderID,n_Silver...", i.e., not being encoded as "%2C"
So, here the difference, if set "...&excludes=n_Bronze,n_genderID,n_Silver&..." as memec_key, the "," was not encoded,
if set "...&excludes=n_Bronze%2Cn_genderID%2Cn_Silver&..." as memec_key, the "%2C" was encoded as "%252C"
On Mon, Jul 2, 2012 at 12:06 AM, james_openresty <ming....@gmail.com> wrote:
> But when I checked memcached, the key was "...
> the value was "...excludes=n_Bronze%2Cn_genderID%2Cn_Silver..."
> I'd like the key to be same as the value, i.e., %2C not be encoded again as
> I know ngx.location.capture will encode the query, but set_unescape_uri
> should restore them back. Why the key can't act the same as the value?
That's because you encoded "," twice but only decode it once :)
The ngx_memc module will encode the memcached keys as URI, just like
the standard ngx_memcached module. And that's why your keys look
different than your values because the key has encoded one more time