Check out the cache utility in gaeutilities.
http://gaeutilities.appspot.com/cache
Looking at the demo, it appears I need to update that page. Anyhow,
cache uses both the datastore and the memcache.
When you write a cache entry, it writes to the datastore, then to
memcache.
When you attempt to read a cache entry, it first tries memcache, then
the datastore.
If there's a hit in the datastore, but not the memcache, it populates
the memcache.
Supports timeout functionality (my cache hit is only good for 5
minutes), and can be used as a standard dictionary object
c = cache.Cache()
c['cachehit'] = "test value"
if 'cachehit' in c:
do_something()
It was originally written before appengine had memcache support, and
was updated when that was provided.