Zend_Cache backend
Redis is a nice solution for caching your data.
Rediska provides Redis adapter for Zend_Cache.
<?php // About initialize and working with Zend_Cache // read offical Zend_Cache manual: // http://framework.zend.com/manual/en/zend.cache.html // Core frontend options $frontendOptions = array( 'cache_id_prefix' => 'Application_', 'automatic_serialization' => true ); // Redis backend options $backendOptions = array( // rediska - Rediska instance name, Rediska object or Rediska options for new instance. Default instance if not specified. 'rediska' => new Rediska(), ); $cache = Zend_Cache::factory( 'Core', 'Rediska_Zend_Cache_Backend_Redis', $frontendOptions, $backendOptions, false, true ); $data = array(1, 2, 3); $cache->save($data, 'data'); ?>
Good morning,
Thanks for implementing your library for Zend.
I just tested the code above, and it seems that the Cache need serialize information.(error is thrown)
I just put to make the sample works
$data = serialize(array(1, 2, 3));
And it's working fine.
Regards,
Arnaud
I fix it, thanks!