Thursday, January 22nd, 2009

JsMemcached.js: JavaScript Jaxer Client

Category: Aptana, JavaScript

<>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):

javascript
< view plain text >
  1. JsMemcached.set("keyName", "Value here, as long as you want");
  2.  
  3. JsMemcached.get("keyName");
  4.  
  5. JsMemcached.close(); // no open() as it is lazily done on your behalf

Posted by Dion Almaer at 4:08 am
3 Comments

++---
2.9 rating from 20 votes

3 Comments »

Comments feed TrackBack URI

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.

Comment by drlongghost — January 22, 2009

@drlongghost
It’s serverside JavaScript, so won’t use it in browser.

Comment by emjot — January 22, 2009

Good, Hope that SSJS will have a nice delevelopment in the future!

Comment by KKFC — January 22, 2009

Leave a comment

You must be logged in to post a comment.