Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Local Object Cache Pro config for Lando #9309

Closed
wants to merge 2 commits into from

Conversation

RayHollister
Copy link

@RayHollister RayHollister commented Nov 15, 2024

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.

Added note after 6c advising Lando users to disable Redis to prevent it from deactivating their server. 

Suggested by @pwtyler and tested by myself.
Wow, good catch. I have no idea where that code snippet came from. I literally copied and pasted from your comment in pantheon-systems#9206

Co-authored-by: Phil Tyler <philip@tylerdigital.com>
@jazzsequence
Copy link
Contributor

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 jazzsequence self-assigned this Nov 19, 2024
@jazzsequence jazzsequence added Topic: WordPress WordPress-specific Topic: Caching Caching related issues at the CDN or CMS level Topic: Local Development Type: Fix Content Issue or PR to resolve incorrect information in the docs labels Nov 19, 2024
@jazzsequence jazzsequence changed the title Update wordpress.md Update Local Object Cache Pro config for Lando Nov 19, 2024
@jazzsequence
Copy link
Contributor

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
Copy link
Contributor

Added my suggested recommendation to #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
Copy link
Contributor

Closing in favor of #9327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Caching Caching related issues at the CDN or CMS level Topic: Local Development Topic: WordPress WordPress-specific Type: Fix Content Issue or PR to resolve incorrect information in the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants