Handling Page Caching
-
Hello,
I’ve been working with the Easy Form Builder plugin and have encountered some challenges with page caching. To address this, we’ve developed the following function to handle page caching plugins in conjunction with 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
}
}
}However, we are now seeking a more integrated solution. Ideally, we would like a structure or approach that aligns with how other plugins manage caching more seamlessly.
I would greatly appreciate any guidance or insights you can share on this topic.
Best regards,
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.