Closed itsyaasir closed 9 months ago
Thanks for this suggestion, its something that I have considered doing and led me down the path of creating a ttl cache macro as a side project. We could definitely use with caching for the access token. Could experiement my custom lib (https://github.com/collinsmuriuki/simple_cache) here or use an existing/ well tested solution.
Interested in taking this up?
@collinsmuriuki I can pick this up
Sure thing @dxphilo, go for it
Currently, we are fetching new key for any request we make, while I don't think there's any problems with it, we can make it more efficient and save on more calls.
My proposal is we can cache the access token which is valid for one hour, and reuse that for the subsequent calls, until the key expires (which is normally one hour). I think this should be pretty easy to make it.
What do you think @collinsmuriuki ?