Nginx gunzip memcached data , xss_callback failed

I use nginx to read mecached data and write to memcached by java
XmemcachedClient . Xmemcached compress data that larger than 256kB
write . So nginx i use ngx_gunzip_module and memcached_gzip_flag to
data from mecached to be sure unzip is Ok . the problem is
is failed . when i delete memcached_gzip_flag , the xss_callback_arg is
,but the result is conrupted . Is there good way to gunzip the memcached
data first , then xss_callback_arg second . this is part of nginx.conf

location ^~ /api/2/topic/nodejs {
set_unescape_uri $topicurl $arg_topicurl;
set_unescape_uri $topicurl $topicurl;
set_md5 $md5_key $arg_client_id$topicurl$arg_topicsid;
set $memcached_key ‘/topic/nodejs?$md5_key’;
memcached_gzip_flag 2;
memcached_pass memcached-cluster;
error_page 404 501 502 = @miss;
xss_get on;
xss_callback_arg ‘callback’;
xss_input_types ‘application/json text/plain’;

Posted at Nginx Forum: