@cache.memoize(timeout=60)
def query_db():
    time.sleep(5)
return 'Results from DB'

@app.route('/')
def index():
    return query_db()
app.run(debug=True)
How to cache sql alchemy calls with Flask-cache and redis?