Sunday, February 24, 2013

Specifying specific Redis database for caching

I am trying to move my caching engine from using File to Redis. The problem that I am facing is that the current Redis instance on my server is already serving other needs using the first few numeric databases. I can't find any documentation within CakePHP which allows me to specify a specific database to sue for cache. I don't want it to go to the default database (i.e. 0) which is already being used by another site for other kind of caching operation. The following is the code from the bootstrap.php file which allows me to configure the cache. What I am looking for is some kind of option which allows me to set the specific database (e.g. 'db' => 3). 

Cache::config('default', array(
'engine' => 'Redis', //[required]
'duration'=> 3600, //[optional]
'probability'=> 100, //[optional]
'prefix' => Inflector::slug(APP_DIR) . '_', //[optional]  prefix every cache file with this string
'server' => '127.0.0.1', // localhost
'port' => 6379, // default port 6379
'timeout' => 0, // timeout in seconds, 0 = unlimited
'persistent' => true, // [optional] set this to false for non-persistent connections
));

Thanks.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: