In most cases you can use Action based cache expiry. However if you need to clear cache after a certain time, you can set the cache expiry to Time based and set the expiry time.
Alternatively you can use the following snippet with a real cron service:
add_action('template_redirect', function(){ $secret = 'EsDfGHss35'; // change this secret to an arbitrary string if (isset($_GET['clear-cache']) && $_GET['clear-cache'] == $secret && class_exists('Swift_Performance_Cache')){ Swift_Performance_Cache::clear_all_cache(); } });
Then you can set up a cron service to clear cache:
curl "https://yoursite.com/?clear-cache=EsDfGHss35"