Implements cache logic for Google App Engine's Datastore service with instance cache and memcache.