✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Server side caching using redis

Hello!

I am trying to replicate example 4 in this part of the documentation, using redis cache instead. I am not exactly sure how to configure the cache properly. Assuming that I have my redis DB set up, is it enough to add:

cache = Cache(app.server, config={
    'CACHE_TYPE': 'redis',
    'CACHE_REDIS_URL': 'redis://{}:{}'.format(REDIS_HOST, REDIS_PORT),
    'CACHE_DEFAULT_TIMEOUT': 450
})

What happens with CACHE_THRESHOLD? Is this not necessary? (reading the flask cache documentation it seems like this parameter is not used for redis).

1 Like