Yii 1.1: rediscache

Use Redis as your cache system

Use Redis as your cache system

Redis is a great cache system, it store the cache in ram and send it to the hard drive once in a while, so you dont lose when the pc shut down


  • PHP 5.2.x
  • Tested with Yii 1.1.5, should work with any 1.1.*
  • A redis server running


Download and extract it on your extensions folder . The main file must be located in application.extensions.redis.CRedisCache

To setup :

define in the application's configuration array ( by default configs/main.php)

                        //if you dont set up the servers options it will use the default one 
                                //if you use 2 servers

Be sure that its under components

then you can use any redis function by calling it normally Yii way, like :

//yii's default functions
//redis specific functions
//example of selecting a db


  • 0.2 Fixed a couple of bugs and rewrite of the code (25/02/11)
  • 0.1 Release


forum / suport

It uses Predis as redis php client

Thumbs up

Total 7 comments

#16796 report it
Rajith R at 2014/03/29 02:29am
Hi Gustavo / muayyad alsadi


This is a great extension .

I am using YIi User modules for user management . Is there any change in needed in user module when i use redis ?

#13467 report it
realtebo at 2013/05/30 04:11am
i'm moving to the forum

Please, follow me on the forum to go on with replying.

#13466 report it
muayyad alsadi at 2013/05/30 03:46am
it was the latest

I've done that on 2012/06/03. no worries the Predis is included in the archive attached in forum

it's here is you want it https://github.com/nrk/predis/tree/v0.7.2

#13465 report it
realtebo at 2013/05/30 03:39am
PRedis 7.2 ?

Sorry, but at


version is 0.8 ! What's 7.2?

Also, YiiRedis require a php extension and we CANNOT use it. I need a php pure library

#13464 report it
muayyad alsadi at 2013/05/30 03:28am
yii redis

@realtebo it seems it's dead, I've upgraded the Predis to 7.2, and fixed it

it seems fine for my needs, but others are reporting that mget watch does not work see the yii forum link above

you might consider this alternative https://github.com/phpnode/YiiRedis

#13463 report it
realtebo at 2013/05/30 03:02am
is it updated and mantained ?

We'd like to start using your extension for a large application.

It looks like a very good start point, could you tell me if this extensions is 'live', is maintened and keep updated ?

#8437 report it
muayyad alsadi at 2012/06/03 09:21am
suggested update to Predis 7.2

here is an updated version


you can discuss it in the forum


Leave a comment

Please to leave your comment.

Create extension