Memcached/JSONP

dylanz nginx-forum at nginx.us
Sun Dec 20 05:31:31 MSK 2009


Yep, I think you got it ;)

So on the first request to this URI:
http://example.com/blah/9999999.json?callback=ding1111111

... we may set the following data in Memcached for that resource:
key:     /blah/9999999.json
value:  john: {age: 20, gender: 'male'}

The next request to the same resource may look like this:
http://example.com/blah/9999999.json?callback=ding2222222

... so since the $memcached_key will match, Nginx will want to respond with:
john: {age: 20, gender: 'male'}

However, we really want to respond with the above value, but wrapped in the callback value from the request, like:
ding2222222(john: {age: 20, gender: 'male')

Let me know what you think :)
Thanks!
==
Dylan

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,31961,32021#msg-32021




More information about the nginx mailing list