• Resolved hassantafreshi

    (@hassantafreshi)


    I’m currently developing the Easy Form Builder plugin and need some advice on potential conflicts with W3 Total Cache.

    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;
    }

    My concern is whether using wp_cache_get and wp_cache_set for internal caching might cause any conflicts with W3 Total Cache. 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 to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hassantafreshi

    Thank you for reaching out and I am happy to help!
    Can you please share if you made any tests with the W3 Total Cache and do you have any issues that you encoundered?

    Thanks!

    Thread Starter hassantafreshi

    (@hassantafreshi)

    Thank you for your prompt response. We haven’t conducted any tests yet, but we have a question regarding the development of a new feature for the next version of Easy Form Builder that we are planning to release. We aim to improve the performance of the plugin by caching a frequently used class, which includes functions and a list of all translated texts, using the wp_cache_get and wp_cache_set functions. This class does not contain any nonce, JavaScript, or CSS files. Our goal with caching is to reduce the execution time and repeated calls to this class. Does your plugin have any specific monitoring or interactions with these functions and their operations?
    Thank you

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hassantafreshi

    Thank you for your question

    There should be no problem or conflict with the W3TC. However, pelase let us know if you experience any issues while testing.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Caching Code Compatibility with W3 Total Cache’ is closed to new replies.