Exploring requests-cache
Occasionally, you might want to cache a library that uses requests internally or maybe you don't want to manage the cache classes and handling yourself. If this is the case, requests-cache (https://github.com/reclosedev/requests-cache) is a great library that implements a few different backend options for creating a cache for the requests library. When using requests-cache, all get requests to access a URL via the requests library will first check the cache and only request the page if it's not found.
requests-cache supports several backends including Redis, MongoDB (a NoSQL database), SQLite (a lightweight relational database), and memory (which is not persistent, and therefore not recommended). Since we already ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access