0

I have developed a plugin for worpress but it is giving me problems when I start MEMCACHE o REDIS CACHE.

I have been told that the problem is that I am using wp_options directly and that I should replace it by accessing object cache through standard wordpress interfaces and not doing it directly.

so how should i do to override these wp_options methods to object cache interfaces?

add_option( $option, $value, $deprecated, $autoload);
delete_option( $option );
get_option( $option, $default = false );
update_option( $option, $newvalue, $autoload );

Thank you very much in advance and greetings

3
  • How are you currently using wp_options? What actual problems were you experiencing? May 26, 2021 at 12:18
  • Who told you this? You are correct to use get_option etc, as a user of both Redis object cache dropins and memcached I and others use the options API on lots of enterprise grade sites that handle billions of page views, I would treat the advice you recieved with great suspicion, those are the standard interfaces. Instead, ask about your problems, not how to implement the proposed solution (This is an X Y Problem)
    – Tom J Nowell
    May 26, 2021 at 12:48
  • i am getting 504 errors with my plugin when i turn on memcache May 26, 2021 at 13:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.