I have a Zend Framework project, and I decided to use Rediska as a Redis client. Rediska has a cache adapter for ZF - Rediska_Zend_Cache_Backend_Redis.
I retrieve DB objects from the collection of objects and try to save it in the cache, but I get an error: connection time checked. My sample code is:
$rediskaOptions = array( 'name' => 'cache', 'namespace' => 'Cache_', 'servers' => array( 'cache' => array( 'host' => Rediska_Connection::DEFAULT_HOST, 'port' => Rediska_Connection::DEFAULT_PORT, 'password' => 'qwerty' ) ) ); $cache = Zend_Cache::factory('Core', 'Rediska_Zend_Cache_Backend_Redis', array('lifetime' => NULL, 'automatic_serialization' => true), array('rediska' => $rediskaOptions), false, true ); $cacheId = 'news_main'; if (!($topics = $cache->load($cacheId))) { $topics = DAOFactory::getInstance()->getTopicDAO()->fetchTopic(1); $cache->save($topics, $cacheId); }
The content size after serialization is 26787 bytes. Perhaps Redis has size limits for sending?
source share