Hi @pixelshrink,
The ticket you are referring to is quite old when there wasn’t a feature to set cache intervals. Hummingbird does offer out of the box setting to set Time intervals so that the cache would get cleared automatically.
You can find the setting under Hummingbird > Caching > Page Caching > Cache interval:
https://imgur.com/tA4Nk2L
Could you please check and see whether the above setting fits your needs?
Please do let us know if you still need any further assistance. Have a nice day ahead.
Kind Regards,
Nithin
Hi, thanks very much for that. What I want is to clear the cache at a specific time though, not just an interval – is that possible?
Thanks very much. I don’t suppose you have a code snippet available? One of your developers seemed to already come up with a solution on https://wpmudev.com/forums/topic/setting-hummingbird-to-auto-clear-cache/, I was wondering if you could send me what they did.
Hi @pixelshrink
You can test this code:
<?php
// Set specific time
wp_schedule_event( strtotime('17:40:00'), 'daily', 'hb_custom_call_function' );
///hook to fire
add_action( 'hb_custom_call_function', 'hb_custom_function' );
//create your function, that runs on cron
function hb_custom_function() {
// Clear all the cache
do_action( 'wphb_clear_page_cache' );
}
It is sets to run every day at 17:40:00,
You can use it as a mu-plugin https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Best Regards
Patrick Freitas
Hello @pixelshrink ,
We haven’t heard from you for several days now, so it looks like you don’t have more questions for us.
Feel free to re-open this ticket if needed.
Kind regards
Kasia