Expiring caches with the passage of time [26.11.2008]
Until now, if you created a blog post in a Blueprint site and set it to publish in three days, it would not appear on the site automatically in three days. Instead, it would appear whenever any site data changed after that three days had elapsed (ie, when the site cache was purged).
With active sites, this has never really mattered — purges occur frequently enough that the cached pages stay fresh. With less frequently updated sites however, pages can get really stale.
I've just introduced an additional task to the Blueprint itinerary which purges the cache of any site that has one or more items being published that day. This resolves that problem.
There are a few other dates and times stored in the various blueprints that might affect the content of the site as they pass. The start_date and end_date of an Event, for instance, or the available_date of a Product.
You can flag these cache-sensitive dates in the blueprint_model declaration for the model — here's what it might look like for EvtEvent:
blueprint_model(
:cache_sensitive => [:start_date, :end_date],
)
For any specified date, just after midnight on that date the site cache will be purged.
For any specified datetime, the site cache will be purged just after the midnight following that moment in time.