Cache
As we have seen in Chapter 3, Web Scraping Etiquette, caching web pages is an essential part of an efficient web scraper. With a cache, we are able to avoid requesting content from a website if we know nothing has changed. In our previous examples, we used a local cache which saves the content into a folder on the local machine. In larger web scrapers with multiple machines, this causes problems, as each machine would need to maintain its own cache. Having a shared caching solution would solve this problem and increase the efficiency of your web scraper.
There are many different ways to approach this problem. Much like the queuing system, a database can help store a cache of your information. Most databases support storage of binary ...
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