Thursday, January 22nd, 2009
JsMemcached.js: JavaScript Jaxer Client
<>p>Rakesh Pai has created a Jaxer JavaScript client for Memcached.Once you load the file you simple configure the main object (change the file rather than calling .config(...) which would make more sense):
-
-
JsMemcached.set("keyName", "Value here, as long as you want");
-
-
JsMemcached.get("keyName");
-
-
JsMemcached.close(); // no open() as it is lazily done on your behalf
-
Related Content:











Connecting to memcached directly from javascript never occured to me and I can see it being very useful. I’m not familiar with Jaxer and how it is actually opening the socket to the memcached server(s), but my hunch is that its using the web server to bridge the connection (or that this code is intended to run on a web server).
After doing some googling, it looks like there are some socket libraries that let javascript access sockets via Flash, which would seem faster than using a proxy server.
I can see the flash solution being useful if you wanted to shave some milliseconds off the response time by going straight to the source (memcached) rather than using a standard Ajax call to a web server which may or may not need to query memcached in turn.
@drlongghost
It’s serverside JavaScript, so won’t use it in browser.
Good, Hope that SSJS will have a nice delevelopment in the future!