• hassantafreshi

    (@hassantafreshi)


    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)
  • Hi there,

    The WP Speed of Light plugin doesn’t currently have a specific option to clear the cache for a single post or page.

    However, you can add a custom function to clear the cache for your specific EFB page. This can be done using the wpsol_purge_cache action hook.

    I hope this helps!

    Thread Starter hassantafreshi

    (@hassantafreshi)

    @viennguyen

    Thank you for your response. Could you please guide me on how exactly I can use this hook considering the structure of our current function?

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