See the options here: https://flask-caching.readthedocs.io/en/latest/
There is a clear cache function (cache.clear()
) but you can also set the max number of items so that once the cache starts saving more than that number, the first items are deleted (CACHE_THRESHOLD
)