• Hi,

    I’ve been working with the Easy Form Builder plugin and have encountered some issues with page caching. To manage this, we created a function to handle different 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 for other plugins can be added here
    }
    }
    }

    However, we are now aiming for a more cohesive solution. Ideally, we want an approach similar to how other plugins handle caching for better compatibility.

    Any advice or recommendations would be highly appreciated.

    Best regards,

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Hamza Mairaj

    (@thevisionofhamza)

    Hey there,

    You can flush a page cache using a method from the berqCache class:

    $page_path = bwp_url_into_path($page_url);
    berqCache::delete_page_cache_files($page_path);

    With this simple code, you can flush the cache for any page. Just note that our plugin slug is “searchpro”.

    Cheers,
    Hamza

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.