Title: Custom Caching Code Compatibility with Speed Optimizer
Last modified: August 7, 2024

---

# Custom Caching Code Compatibility with Speed Optimizer

 *  Resolved [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/custom-caching-code-compatibility-with-speed-optimizer/)
 * Hi,
   I’m currently developing the [Easy Form Builder plugin](https://wordpress.org/plugins/easy-form-builder/)
   and need some advice on potential conflicts with Speed Optimizer.
 * Here’s the function I’m 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 Speed Optimizer. 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!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-caching-code-compatibility-with-speed-optimizer%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Daniela Ivanova](https://wordpress.org/support/users/daniellaivanova/)
 * (@daniellaivanova)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/custom-caching-code-compatibility-with-speed-optimizer/#post-17937856)
 * Hello [@hassantafreshi](https://wordpress.org/support/users/hassantafreshi/),
   
   Using `wp_cache_get` and `wp_cache_set` is a standard and efficient way to handle
   internal caching in WordPress and generally should not cause conflicts with caching
   plugins like Speed Optimizer. By following the best practices and thoroughly 
   testing your plugin, you can minimize the risk of conflicts with Speed Optimizer
   or other caching plugins.Test your plugin with Speed Optimizer to ensure there
   are no conflicts. If there are such – you can always contact us so we can review
   the problem.Best Regards,Daniela Ivanova
 *  Thread Starter [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/custom-caching-code-compatibility-with-speed-optimizer/#post-17937872)
 * Hello [@daniellaivanova](https://wordpress.org/support/users/daniellaivanova/),
   
   Thank you for your quick and comprehensive response.

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

The topic ‘Custom Caching Code Compatibility with Speed Optimizer’ is closed to 
new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

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

 * 2 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/custom-caching-code-compatibility-with-speed-optimizer/#post-17937872)
 * Status: resolved