HTTP ?

Andy memcached at thwartedefforts.org
Wed Nov 17 08:28:35 PST 2004


On Wed, 2004-11-17 at 08:39, John Allspaw wrote:
> What I mean is this...
> 
> Currently, as I understand it, memcached listens on a socket (IP/port)
> and takes traffic from clients in various ways (php, perl, etc.) but
> the protocol it talks is all raw TCP, yes ?

Doesn't this misrepresent the protocol layers?  Memcached talks the
protocol documented in doc/protocol.txt over TCP, just like web servers
talk HTTP over TCP.  Applications that grok "raw TCP" would be things
like ethereal.

> I'm wondering if anyone has written an HTTP (specifically 1.1) wrapper
> for this traffic, so a POST could set/add/replace a key, and a GET
> could get one.  In other words, you'd ask the memcached for data via a
> URL.

This would be interesting, although kind of weird.  I could see the use
for this if you put a proxy or a port-80-only firewall between your
memcached servers and your memcached clients, but this seems like a
dubious network design considering where memcached is designed to be
placed on your network... 

but... thinking about it more... you could set up some distributed web
caches using this.  Support HTTP Auth to set keys, and pass web browsers
absolute URLs to externally accessible memcached instances.  The 1meg
limit might be an issue for some larger files.  It might be worth
testing to see if memcached is faster using HTTP than some of the
speed-demon web servers designed for serving static files directly from
the file system...  Without HTTP being built into memcached, I bet a
wrapper would be like a 20 line PHP CGI or Perl script using LWP as the
server, if one were to use the current memcached client API libs for
talking to the memcached server.

Andy.



More information about the memcached mailing list