Follow me on twitter…

Zend_Cache backend

Redis is a nice solution for caching your data.

Rediska provides Redis adapter for Zend_Cache.


// About initialize and working with Zend_Cache
// read offical Zend_Cache manual:

// 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(

$data = array(1, 2, 3);
$cache->save($data, 'data');



Nauw October 18, 2010 21:50

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.



Ivan Shumkov October 20, 2010 17:59

I fix it, thanks!

wormhit April 04, 2012 07:12

I'm using ZF ver 1.11.11

$cache = Zend_Cache::factory(
new Rediska_Zend_Cache_Backend_Redis(),

Fork me on GitHub