Title: Does This Custom Caching Code Interfere with Breeze ?
Last modified: July 31, 2024

---

# Does This Custom Caching Code Interfere with Breeze ?

 *  Resolved [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/)
 * As the developer of the[ Easy Form Builder plugin](https://wordpress.org/plugins/easy-form-builder/),
   I’m seeking some advice about potential conflicts with Breeze.
 * Here is the function I am currently using for internal caching:
 *     ```wp-block-code
       public function get_efbFunction($state) {    if (isset($this->efbFunction)) return $this->efbFunction;    $efbFunctionInstance;    if (false === ($efbFunctionInstance = wp_cache_get('efbFunctionInstance', 'emsfb'))) {        if (!class_exists('Emsfb\efbFunction')) {            require_once(EMSFB_PLUGIN_DIRECTORY . 'includes/functions.php');        }        $efbFunctionInstance = new \Emsfb\efbFunction();        wp_cache_set('efbFunctionInstance', $efbFunctionInstance, 'emsfb', 3600); // 1 hour cache    }    $this->efbFunction = $efbFunctionInstance;    if ($state == 1) return $this->efbFunction;}
       ```
   
 * My concern is whether using `wp_cache_get` and `wp_cache_set` for internal caching
   might cause any conflicts with [Breeze – WordPress Cache Plugin]. Has anyone 
   had similar experiences or know of best practices to ensure they work together
   smoothly?
 * Any guidance or insights would be greatly appreciated.
 * Thank you for your help!
 * Best regards,
    -  This topic was modified 1 year, 10 months ago by [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/).

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * (@owaisalam)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17925406)
 * I’ve installed the plugin and conducted some preliminary testing, but I’m uncertain
   about what specific issues I should be focusing on. Could you provide more details
   on the exact nature of the problem? Specifically, what kind of conflict is occurring,
   and what abnormal behavior or symptoms should I be looking for? Any additional
   guidance on how to identify or reproduce the issue would be greatly appreciated.
 *  Thread Starter [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17930299)
 * Thank you for your response and review. To facilitate a more thorough examination,
   please conduct the test on the version available on GitHub at the following link.
 * [https://github.com/hassantafreshi/easy-form-builder/tree/dev4](https://github.com/hassantafreshi/easy-form-builder/tree/dev4)
 *  We have communicated with cache plugin developers prior to release to prevent
   any potential issues. The get_efbFunction is also called when the form is published,
   and if it causes any problems, it will be with the cache plugin on public pages.
   My final question is: Does your plugin make any changes or oversee the functionality
   of the wp_cache_set function that could potentially cause conflicts?
 * Thank you.
 *  Plugin Author [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * (@owaisalam)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17935785)
 * Thanks for sharing the details. Breeze only caches the rendered page and does
   not conflict with the `wp_cache_set` function. Let me explain the functionality
   of the Breeze caching system. When the Breeze cache system is enabled, the plugin
   creates a cache of pages visited by users according to the settings applied in
   Breeze. Throughout this process, Breeze does not conflict with any functions 
   used in the activated theme or other plugins, as you mentioned in your question.
 * If you still have any questions, please feel free to ask.
 *  Thread Starter [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17939172)
 * Thank you for the response. We use the following function to handle page caching
   with plugins. Do you have a structure similar to other plugins that we can add
   to solve the caching issue?
 *     ```wp-block-code
       public function cache_cleaner_Efb($page_id){        if (defined('LSCWP_V') || defined('LSCWP_BASENAME' )){            //litespeed done                        do_action( 'litespeed_purge_post', $page_id );        }else if (function_exists('rocket_clean_post')){            //wp-rocket done                                $r = rocket_clean_post($page_id);                  }elseif (function_exists('wp_cache_post_change')){            //WP Super Cache done                      //Jetpack done            $GLOBALS['super_cache_enabled']=1;            wp_cache_post_change($page_id);        }elseif(function_exists('autoptimize_filter_js_noptimize ')){            //auto-Optimize done            autoptimize_filter_js_exclude(['jquery.min-efb.js','core-efb.js']);            autoptimize_filter_js_noptimize();        }elseif(class_exists('WPO_Page_Cache')){            //WP-Optimize done            \WPO_Page_Cache::delete_single_post_cache($page_id);        }elseif(function_exists('w3tc_flush_post')){            //W3 Total Cache done                      w3tc_flush_post($page_id);        }elseif(function_exists('wpfc_clear_post_cache_by_id')){            //WP Fastest Cache done            wpfc_clear_post_cache_by_id($page_id);        }elseif(has_action('wphb_clear_page_cache')){            //Hummingbird done                      do_action( 'wphb_clear_page_cache', $page_id );        }    }
       ```
   
 * [Click here to get the full source code on GitHub.](https://github.com/hassantafreshi/easy-form-builder/blob/cbbf8b3566ce3eb1a956775aa038bd201215ed94/includes/class-Emsfb-public.php#L3696).
 * Thank you.
 *  Plugin Author [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * (@owaisalam)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17941115)
 * It would be great to add the following filter to clear the cache
   do_action(‘breeze_clear_all_cache’);
 *  Thread Starter [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17941173)
 * Thank you for your assistance, I will added this code , what do you think ?
 *     ```wp-block-code
       elseif(has_action('breeze_clear_all_cache')){   do_action('breeze_clear_all_cache');}
       ```
   
 *  Plugin Author [owaisalam](https://wordpress.org/support/users/owaisalam/)
 * (@owaisalam)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17943471)
 * Yes, it seems fine.
 *  Thread Starter [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17943510)
 * Thank you

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Does This Custom Caching Code Interfere with Breeze ?’ is closed to new
replies.

 * ![](https://ps.w.org/breeze/assets/icon-256x256.gif?rev=3352595)
 * [Breeze Cache](https://wordpress.org/plugins/breeze/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/breeze/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/breeze/)
 * [Active Topics](https://wordpress.org/support/plugin/breeze/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/breeze/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/breeze/reviews/)

## Tags

 * [question](https://wordpress.org/support/topic-tag/question/)

 * 8 replies
 * 2 participants
 * Last reply from: [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/does-this-custom-caching-code-interfere-with-breeze-wordpress-cache-plugin/#post-17943510)
 * Status: resolved