Add support for Memcached SASL
-
My Memcached instance is protected with SASL and requires a username and password to access. I connect to my Memcached server outside of WordPress I pass a few extra options to the class to authentication the connection. Typically that connection would look something like this:
$memcache = new Memcached(); $memcache->setOption( Memcached::OPT_BINARY_PROTOCOL, true ); $memcache->setSaslAuthData( "memcached_user", "hunter2" ); $memcache->addServer( '127.0.0.1', 11211 ) or die ("Could not connect");
When I started looking to use Memcache for WordPress there was very little discussion around SASL usage with existing drop-in options. It would be great to see these options added to this plugin allowing the connection to be made.
When I attempted to install the plugin as is I get a 504 timeout in the browser due to the server connection failing authentication to
Memcached()
.I reviewed the plugin’s code and didn’t see a way to add SASL but I think since this is “advanced” having it defined as a constant would be the easiest way.
- The topic ‘Add support for Memcached SASL’ is closed to new replies.