pantheon-systems / documentation

Pantheon Docs
https://docs.pantheon.io
Other
194 stars 671 forks source link

Update Local Object Cache Pro config for Lando #9309

Closed RayHollister closed 1 week ago

RayHollister commented 2 weeks ago

Summary

Enable Object Cache Pro for WordPress - Added note after 6c advising Lando users to disable Redis to prevent it from deactivating their server. Suggested by @pwtyler and tested by myself.

jazzsequence commented 1 week ago

Rather than just disabling Redis on Lando, I'd like to see if it's possible to get Redis to actually work with Lando. The errors in #9206 suggest 'serializer' => 'php' and 'compression' => '<something that's not zstandard>' would work for an alternate config. Possibly those could just be unset from the configuration for local? I'll do some digging, but if you want to test those config changes, that would also be great. I'd like disabling Redis entirely to be a last resort.

jazzsequence commented 1 week ago

This is what I've got set and seems to be working locally:

$ocp_settings = [
    // All your OCP defaults, except use the following for the token:
    'token' => isset( getenv( 'OCP_LICENSE' ) ) ? getenv( 'OCP_LICENSE' ) : '',
     // ...other stuff...
];

if ( isset( $_ENV['LANDO'] && 'ON' === $_ENV['LANDO'] ) {
    $ocp_settings['serializer'] = 'php';
    $ocp_settings['compression'] = 'none';
}

define( 'WP_REDIS_CONFIG', $ocp_settings );

Note: I'm getting a License error locally even when the token is correct. I've a side conversation with Till from OCP about that, but I don't think the license impedes functionality, so I think just an empty string for that as a default would still work.

jazzsequence commented 1 week ago

Added my suggested recommendation to https://github.com/pantheon-systems/documentation/pull/9327. I prefer this because I would rather not recommend simply disabling OCP (but that's included as an option).

There's other changes I've been meaning to make in there, too.

jazzsequence commented 1 week ago

Closing in favor of https://github.com/pantheon-systems/documentation/pull/9327