Is there any configuration hint for enabling memcache in Craft 3? I'm on 3-beta-24
'cacheMethod' => 'memcache',
to config/general.php, but this did neither cause any hits on memcache nor any error.
The Craft 2 (sic!) docs say you also need config/memcache.php, which I created
- returning an empty array
- returning an array containing the properties I found in *app/vendor/craftcms/cms/src/config/MemCacheConfig.php:
- returning a 2 dimensional array with the the first array containing the properties from 2. above
Nothing worked, but 2. & 3. throw unknown property exceptions.
This is my memcache.php (according to variant 3. above):
return [ [ // A memcached server hostname or IP address. 'host' => 'localhost', // Whether or not to use a persistent connection. 'persistent' => true, // The memcached server port. 'port' => 11211, // How often a failed server will be retried (in seconds). 'retryInterval' => 15, // If the server should be flagged as online upon a failure. 'status' => true, // The value in seconds which will be used for connecting to the server. 'timeout' => 15, // Probability of using this server among all servers. 'weight' => 1, ] ];
This is the exception:
Unknown Property – yii\base\UnknownPropertyException Setting unknown property: craft\config\MemCacheConfig::0 in .../app/vendor/yiisoft/yii2/base/Object.php at line 161
looks like the config can't handle multiple memcache servers as array.
Here's the stacktrace: https://pastebin.ca/3855627