وردپرس
Custom Caching Code Compatibility with Cache Enabler
As the developer of the Easy Form Builder plugin, I’m seeking advice on potential conflicts with Cache Enabler.
Here’s the function I’m using for internal caching:
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’m concerned that using wp_cache_get
and wp_cache_set
for internal caching might cause conflicts with Cache Enabler . Has anyone encountered similar issues or know of best practices to ensure compatibility?
Any guidance or insights would be greatly appreciated.
Thank you for your help!
The page I need help with: [log in to see the link]
مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد
منبع: انجمن وردپرس