I am using Flask cache in my python API.
I am currently using the @app.cache.memoize(cache_memoize_value)
decorator and I clear it by calling app.cache.delete_memoized(view)
The problem is that with memoize
it will be cached for representations n
, and not for a certain amount of time. If I want to specify a timeout for the cache, I need to use the @app.cache.cached(timeout=300)
decorator and clear it with app.cache.clear()
. However, this clear-cut method will clear everything, not just a specific view.
How can I clear a specific view when using a cached decorator?
source share