I'm working on a mashup site and would like to limit the number of fetches to scrape the source sites. There is essentially one bit of data I need, an integer, and would like to cache it with a defined expiration period.
To clarify, I only want to cache the integer, not the entire page source.
Is there a ruby or rails feature or gem that already accomplishes this for me?
Yes, there is
ActiveSupport::Cache::Store
Regarding the expiration time, this can be done by passing the time as a initialization parameter
If you want to cache a value with a different expiration time, you can also set this when writing a value to the cache