I have a Flask app, and I have implemented the "Flask-Caching" extension. I am using the "FileSystemCache" method. This is all new to me so it may be working properly and I'm unaware.
I have found that when I call cache.clear(), I will see items delete from the directory specified as my cache location. However, when I set the timeout to be something really short, I do not see the files delete when the timeout duration is reached.
I'm not sure if it is supposed to delete or if I should write a background task to delete all files older than the timeout setting. Each file is small but they accumulate very quickly.
I ask that someone advise me if this is working as intended. Creating a background task to clear the directory is no issue but it seems like this should be happening automatically.
In terms of relevant code, there isn't much:
cache = Cache(app,config={'CACHE_TYPE': 'filesystem',
'CACHE_DIR': r"<my cache directory>",
'CACHE_DEFAULT_TIMEOUT': 15})
The timeout is only 15 seconds to aid my testing here but it will be increased later. Throughout my code, I'm only really using @cache.memoize() and the occasional cache.delete_memoized().