Context and Page Caching Just started a gigantic Drupal build and I'm trying to validate if the Context Module is the correct option for a segmented content delivery system. It appears to be and I am optimistic.

The project calls for about 100 custom "variables" that the site administrators can segment content with. As a test, I've created a custom context condition of time of day. If the condition is set for >= 2PM for example with a reaction of showing the Powered By Drupal block in the footer, everything works as expected - Before 2PM, no block and after 2PM, block. So the context condition is working as expected.

Now, I've enabled page caching with lifetime and expiration set to 1 day. If I clear the cache before 2PM and hit the page, the block does not show as expected. If I hit the page (which is previously cached) after 2PM, still no block.

I have used a "preboot" method to modify the cache key, but in my example above, the cache key would include the hour and the minute, effectively reducing the cached copy of a page to 1 minute. I might as well turn page caching off in that case!

Is it possible to run the context conditions on a cached page? Has anyone found a way to make this happen?
If you have access to your ssh console, you can use cron

crontab -e


Then you put inside, at the bottom:

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 14 * * * cd /var/www/drupal &amp;&amp; drush cc all


the above will clear the cache with drush everyday at 2pm.  

A few notes: 


replace cd /var/www/drupal with the actual path to your drupal.
I believe the default runs at UTC time.
You need to install drush if you haven't already.


An alternative to using Drush, you could create a PHP or Python or NodeJS etc.. file that uses mysql to delete the row that holds the page cache in your DB, and run the file with cron at 2pm.