3 ms·
For a simple caching solution that works well with requests, you can look at cachecontrol: from cachecontrol import CacheControl sess = requests.s
by ivan_ah 9y ago
For a simple caching solution that works well with requests, you can look at cachecontrol:
from cachecontrol import CacheControl
sess = requests.session()
cached_sess = CacheControl(sess)
response = cached_sess.get('http://google.com')
Very good for interactive debugging when you have to make multiple GET requests. First time you'll hit the webserver, after that it's all served from cache.
- staticautomatic 9y agorequests.session() --> requests.Session()