Caching html / blobs / ActiveRecords

Short question: what caching packages are available for Rails?

Details: My application requires data scraped from various web sites.
To date, I’ve used scripts to fetch the page in question. Since I never
want to hit a web site twice with the same query, I always save the raw
HTML so I can parse it later (e.g. if I need to rebuild my database). I
then parse the stored HTML and load the results into ActiveRecords:

Web S. => [mechanize] => stored HTML => [parse and save!] =>

I’d like to automate this so if MyActiveRecord.find() doesn’t turn up
anything, it will first look for stored HTML, and if it can’t find any
stored HTML will trigger a fetch from the web site.

Before I write this from scratch, I should ask: are there any caching
packages for Rails that do some or all of this?


  • ff