Yii Frame Work !Configuring for cache

Thursday, January 5, 2012

Configuring for cache
As was mentioned, using cache in Yii typically involves choosing one of these
implementations, and then configuring the application component for use in the /
protected/config/main.php  file. The specifics of the configuration will, of course,
depend on the specific cache implementation. For example, if one were to use the
memcached implementation, that is, CMemCache, which is a distributed memory
object caching system that allows you to specify multiple host servers as your cache
servers, configuring it to use two servers might look similar to:
...........................................
array(
    ......
    'components'=>array(
        ......
        'cache'=>array(
            'class'=>'system.caching.CMemCache',
            'servers'=>array(
                array('host'=>'server1', 'port'=>12345, 
'weight'=>60),
                array('host'=>'server2', 'port'=>12345, 
'weight'=>40),
            ),
        ),
    ),
);
........................................................
To keep things relatively simple for the reader following along with the TrackStar
development, we'll use the filesystem implementation, CFileCache, as we go
through some examples. This should be readily available on any development
environment that allows access to reading and writing files from the filesystem

No comments:

Post a Comment

Your Comment will be visible after approval. Post Free classified ads at www.pkbazaar.com to increase your traffic

 

Online Earning

Top Online Shopping Websites in Pakistan  earn money online online earning

Most Reading

Tags

Result Analytics

free counter