Flask-Restful で Flask-Cache @cache.cached() デコレータを使用するにはどうすればよいですか? たとえば、Resource から継承されたクラス Foo があり、Foo には get、post、put、および delete メソッドがあります。
の後にキャッシュされた結果を無効にするにはどうすればよいPOST
ですか?
@api.resource('/whatever')
class Foo(Resource):
@cache.cached(timeout=10)
def get(self):
return expensive_db_operation()
def post(self):
update_db_here()
## How do I invalidate the value cached in get()?
return something_useful()