Actually i’m getting URL query params, making a request for an API and wanna save the response data on cache because, after that, I need to use this data on a callback and don’t have the mentioned query params for making the request again.
So, I have tried doing this with flask-caching but it didn’t work:
def expensive_func(param1, param2):
@cache.memoize(timeout=TIMEOUT)
def query_data(param1, param2):
url = param1
body = param2
resp = rquests.post(url,body)
return resp.json()
return resp, datetime.now()
I need a function that memoizes the response but on callback I have to call this function without passing the params, only getting the cached data.
Thank you all for any help