Hello!
So, I decided that for funsies I would set up the next site using Memcached instead of Redis as the object cache provider.
The documentation leaves a lot to be desired though, or maybe (most likely?) this is a skill issue
So I’ve added this to the development/wordpress_sites.yml:
object_cache:
enabled: true
provider: memcached
database: 0
And I’ve installed the suggested plugin with
composer require wpackagist-plugin/memcached
Now to the part where I get confused.
The documentation says:
The plugin typically auto-activates when it detects Memcached is available.
Is this an actual thing? Can a plugin auto-activate?
More importantly, when I try to activate the plugin manually I get this error:
Cannot redeclare function wp_cache_add()
Now according to the plugin’s site this is because it requires a very manual installation process:
- Install memcached on at least one server. Note the connection info. The default is
127.0.0.1:11211.- Install the PECL memcache extension
- Copy object-cache.php to wp-content
- Add the
WP_CACHE_KEY_SALTconstant to thewp-config.php:phpdefine( 'WP_CACHE_KEY_SALT', '...long random string...' );
So the question is, what’s the recommended way of using Memcached these days? Is the recommendation a blank “use Redis instead, stoopid!” or is the documentation linking to the wrong plugin or something?
All help, feedback or hate is welcome with open arms.