• Hi,
    I am Developing Easy Form Builder plugin?and encountered some challenges with page caching. To address these issues, we use the following function to handle page caching with our plugins:

    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')) $r = rocket_clean_post($page_id);
    break;
    .
    .
    .

    }
    }

    }

    However, we’re seeking a more integrated solution. Specifically, we’re looking for a structure or method similar to what other plugins use to manage caching effectively.

    Thank you in advance for your help and insights!

    Best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author webheadcoder

    (@webheadllc)

    Hi,

    That code is similar to what this plugin does.

    You can recommend your users install this plugin if they’re having issues with caching. Your plugin can call the ccfm_clear_cache_for_me() function if it exists.

    Thread Starter hassantafreshi

    (@hassantafreshi)

    Thank you for your response. I have a question: when we call the function ccfm_clear_cache_for_me(), does it clear all the cache? We only want to clear the cache related to a specific page, where we have the page ID. Is that possible? Thank you.

    Plugin Author webheadcoder

    (@webheadllc)

    Unfortunately, no, it’s not able to do that. Caching systems usually will clear the cache for a specific page if a page is saved. This plugin was built to clear cache when an item on the page, but not the page itself, is changed.

    Thread Starter hassantafreshi

    (@hassantafreshi)

    @webheadllc My question is: Will calling the function ccfm_clear_cache_for_me() by itself cause any issues?

    Plugin Author webheadcoder

    (@webheadllc)

    Calling the function ccfm_clear_cache_for_me() will clear the cache using the caching system installed, if any. If none of the supported caching systems are found it won’t do anything.

    Thread Starter hassantafreshi

    (@hassantafreshi)

    @webheadllc I understand, thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Handling Page Caching’ is closed to new replies.