FYI, the redis approach only works if you can prime redis with your dataset first.
I found this workflow works well:
result = check ngnxi shared dict
if not result:
result = check redis
if result:
stash in shared dict
if not result:
result = check API server with http request
if result:
stash in redis
stash in shared dict