Title: Custom Caching Code Compatibility with Redis Object Cache
Last modified: August 4, 2024

---

# Custom Caching Code Compatibility with Redis Object Cache

 *  Resolved [hassantafreshi](https://wordpress.org/support/users/hassantafreshi/)
 * (@hassantafreshi)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/custom-caching-code-compatibility-with-redis-object-cache/)
 * I’m Hassan Tafreshi, a developer for the [Easy Form Builder plugin](https://wordpress.org/plugins/easy-form-builder/).
   I have a query about possible conflicts with Redis Object Cache.
 * Below is the function I’m concerned about:
 *     ```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; }
       ```
   
 * I am using `wp_cache_get` and `wp_cache_set` for internal caching. My concern
   is that this might conflict with Redis Object Cache.
 * Has anyone experienced issues with this kind of setup? Are there any best practices
   or specific configurations within Redis Object Cache to avoid conflicts? Any 
   advice or insights would be greatly appreciated.
 * Thank you in advance for your assistance!
 * 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-redis-object-cache%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/custom-caching-code-compatibility-with-redis-object-cache/#post-18006620)
 * using `wp_cache_get()` will always use Redis if Redis Object Cache is installed.
   There should be no conflicts, you can use these methods.

Viewing 1 replies (of 1 total)

The topic ‘Custom Caching Code Compatibility with Redis Object Cache’ is closed 
to new replies.

 * ![](https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513)
 * [Redis Object Cache](https://wordpress.org/plugins/redis-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/redis-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/redis-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redis-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redis-cache/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/custom-caching-code-compatibility-with-redis-object-cache/#post-18006620)
 * Status: resolved