code: def _set_ndb_cache_policy():
    
    ndb_ctx = ndb.get_context()
    ndb_ctx.set_cache_policy(lambda key: False)
    ndb_ctx.set_memcache_policy(lambda key: False)
docs: Tell NDB to never cache anything in memcache or in-process.
  
    This ensures that entities fetched from Datastore input_readers via NDB
    will not bloat up the request memory size and Datastore Puts will avoid
    doing calls to memcache. Without this you get soft memory limit exits,
    which hurts overall throughput.