I am having great speed up using flask-cache configured to work with a redis-server instance. However, if the redis-server becomes unavailable I get an error message:
redis.exceptions.ConnectionError
ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
Since chaching is just to increase performance I would like to configure a fallback (slower) CACHE_TYPE
(e.g., simple
) to deal with redis-server problems without affecting flask functionalities. If not possible I hope to dinamically-programmatically disable the cache to prevent any flask error.
EDIT
I tried to solve the problem on my own: https://github.com/paolinux79/flask-cache