Managing Page Caching in a Different Plugin
-
Hello,
I’ve been developing the Easy Form Builder plugin and have run into some challenges related to page caching. To manage this, we’ve implemented the following function to work with different page caching plugins alongside Easy Form Builder:
public function cache_cleaner_Efb($page_id, $plugins) {
$page_id = intval($page_id);
$cache_plugins = json_decode($plugins);
foreach ($cache_plugins as $plugin) {
switch ($plugin->slug) {
case 'litespeed-cache':
if (defined('LSCWP_V') || defined('LSCWP_BASENAME')) {
do_action('litespeed_purge_post', $page_id);
}
break;
case 'wp-rocket':
if (function_exists('rocket_clean_post')) {
rocket_clean_post($page_id);
}
break;
// Additional cases can be added here for other plugins
}
}
}We are now looking for a more streamlined solution. Ideally, we would like an approach that is more consistent with how other plugins manage caching.
Any guidance or suggestions you can provide would be greatly appreciated!
Best regards,
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.