• Resolved hassantafreshi

    (@hassantafreshi)


    I’m currently developing the?Easy Form Builder plugin?and need some advice on potential conflicts with WP Super 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 WP Super 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 2 replies - 1 through 2 (of 2 total)
  • If the page with your form is cached by WP Super Cache then the internal caching you’re doing won’t matter as the PHP code on that line won’t run when a cached page is displayed.

    This does have a side effect if you’re using a secret key to stop spam that expires, for example, as the secret key will be recorded by the page when it is cached.

    Thread Starter hassantafreshi

    (@hassantafreshi)

    Hi,
    Thank you for your quick and comprehensive response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.