Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


requests.session() --> requests.Session()




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: