Skip to content

Instantly share code, notes, and snippets.

@ryanermita
Last active August 19, 2018 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanermita/1abf01541d1219236b9d98ef1cefb33d to your computer and use it in GitHub Desktop.
Save ryanermita/1abf01541d1219236b9d98ef1cefb33d to your computer and use it in GitHub Desktop.
dict_object = {"firstname": "John", "lastname": "Doe"}
type(dict_object) # dict
# cache dict_object as redis hash
app.redis_connection.hmset("your_unique_key", dict_object)
# fetch cached data (hash) from redis
cached_data = app.redis_connection.hgetall("your_unique_key")
type(cached_data) # dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment