Open
Description
I recently upgraded from Phalcon 4.x to 5.4, but I'm encountering a cache issue with the Memcached adapter. I'm unable to store data on the Memcache server. Can anybody please help me on this.
$di->setShared(
'cache',
function () {
$config = $this->getConfig();
$serializerFactory = new SerializerFactory();
$adapterFactory = new AdapterFactory($serializerFactory);
$options = [
'defaultSerializer' => 'Json',
'lifetime' => 7200,
'servers' => [
0 => [
'host' => 'localhost',
'port' => '11211',
],
],
];
$adapter = $adapterFactory->newInstance('libmemcached', $options);
return new \Phalcon\Cache\Cache($adapter);
}
);
Whenever use to save the cache always returning false
$this->cache->set('id', 20)
Also whenever use directly Memcached class it is working.