Is there a way to schedule cache purges by time period?
No, you can purge cache only once a day by a specific day time. Your need can be done, but not with plugin functions. This needs a custom solution.
Has confirmed.
Need to add a specific feature as a customization?
For example
<?php
// wrap this in a function
if (class_exists('\LiteSpeed\Purge')) {
\LiteSpeed\Purge::purge_all();
}
// another way
if (class_exists('\LiteSpeed\Purge')) {
do_action('litespeed_purge_all');
}
?>
Are you saying this?
best regards
That would be a possible solution, but I prefer another solution that is independent of WordPress and the cache plugin, which is also faster.
Thank you for answer.
Do you know of another quick independent solution?
I do not know.
best regards
Create an empty PHP file with name of your choice, copy the code from below in this file and transfer the file to the root directory of your server where WP is installed. This file can only be run from console (SSH) and you can use it for cron job.
<?php
if (php_sapi_name() !== 'cli') {
exit("\n");
}
$tag = __DIR__;
$tag = $tag . '/wp-content/plugins/litespeed-cache/';
$tag = substr(md5($tag), -3) . '_';
header("X-LiteSpeed-Purge:" . $tag );
Thanks for the reply!
I will give feedback after testing
best regards
Plugin Support
qtwrk
(@qtwrk)
better to use plugin API if possible, e.g.
<?php
require( './wp-load.php' );
if ( defined('LSCWP_V')) {
do_action( 'litespeed_purge_url', '/product/something' );
}
and curl/wget it , don’t run it in PHP CLI