Memcached/JSONP

dylanz nginx-forum at nginx.us
Sun Dec 20 04:25:18 MSK 2009


Hello Peter!

Thank you for the great suggestion, and after I read up on the SSI module, I think I understand the approach.

So, the actual content I store in the cache would be something like:
<!--# include virtual="http://example.com/jsonp_ssi/$args" -->({"cat": meow, "dog": ruff})

On a subsequent request, that content would be retrieved, and replaced with the response from the request (say, "blah123") to http://example.com/jsonp_ssi/$args.
That way, I could parse out the callback value in that parallel request, and the response body would end up something like:
blah123({"cat": meow, "dog": ruff})

I'd need to make some changes to my application and framework, but if the above is correct, this will definitely work!
I may still keep reading Emillers module guide however, as if this was a body filter, it would save that extra request (and it would be a fun exercise ;)).

Let me know what you think,
Thanks!
==
Dylan

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




More information about the nginx mailing list