Closed Natim closed 9 years ago
Thanks for diving into this. I like the idea of a swappable Cache class so we can do different backends. I wonder if we should just bake this into the base oauth.Client class, since it won't hurt and almost everyone will want it.
Maybe something like:
Client()
-> some sensible default caching behaviourClient(cache=None)
-> explicitly disable cachingClient(cache=MyCustomCacheClass())
-> use memcached or redis or whatever you likeThoughts?
Ok let's do that.
Updated.
Great stuff, thanks @Natim. r+ with one nit and one suggestion.
Thank you @rfk. I have updated the PR with your comments.
In future we should iterate on the cache class here, to e.g. enforce a max size as a guard against DOS attacks. Given the short ttls the initial version should be fine though.
@rfk do you agree on the approach?