Code
memcached
# telnet / nc style protocol (text)
set user:42 0 3600 13
hello, world!
# STORED
# ^ flags=0 ^ ttl=3600s ^ bytes=13
get user:42
# VALUE user:42 0 13
# hello, world!
# END
get user:42 user:43
# multiple keys in one request (response per key)
delete user:42
# DELETED
incr counter 1
decr counter 1
# Python (pymemcache)
from pymemcache.client.base import Client
c = Client(("localhost", 11211))
c.set("user:42", b"hello, world!", expire=3600, flags=0)
print(c.get("user:42")) # b"hello, world!"