rails/rails — pull request #16371 by aantix (2014-08-02 06:57:11+00:00)
Title: Expire cache hourly/daily exactly when the hour/day rolls over

Invalidating caches at the top of the hour/day is useful for pages that make data available at specific times. (e.g. new job postings on the hour, or items go on sale at 5am).

I added an :expires option for cache entries/stores. The developer can set this option to :daily or :hourly. This allows the developer to invalidate the cache exactly whenever the hour or day changes.

```ruby
# e.g.
ActiveSupport::Cache::MemoryStore.new(expires: :hourly)
# or
cache.write(key, value, expires: :daily)
```