Expire page cache when Views query cache expires

Events happening in the community are now at Drupal community events on www.drupal.org.
fullerja's picture

I am working with Panels and Views.

I have an Alert that has an expiration datetime. A view on my homepage displays these alerts and uses a date filter to remove them when they pass. I cannot seem to expire the page cache when that change occurs, the issue being that there is no node update action beginning triggered. I can't change to using a publish/unpublish method, because I would like users to be able to see past alerts.

Is anyone aware of methods to expire page cache when view query or render cache expires?

Comments

Passive v. Active

andy_read's picture

Interesting problem. A view with a date filter is implicitly passive, i.e. it will simply show the alerts that are [still] current - there is nothing to trigger an event because the filter understands nothing about changes in state.

I can't think of any specific solution to this immediately, but two ideas come to mind:
1. If the expiry times are always whole days or hours then it might be reasonable to just expire the cache with cron.
2. If each alert has a very specific expiry time, then you may need to have a bit of custom code in the hook_save which picks up the expiry time and sets a specific cron job to expire the page cache.

These are initial quick thoughts only, which hopefully might prompt a solution from some direction :-)

Thanks!

fullerja's picture

I think the cron expiration is the best method in my case, the changes to the filter are predictable.

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: