Yii Framework Forum: [Help] Simple And Fast Way Yii Caching - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Help] Simple And Fast Way Yii Caching Rate Topic: -----

#1 User is offline   Interboy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 31-August 11

Posted 11 October 2012 - 06:36 AM

Hi everyone,

Anyone help me to perform Caching in Yii in easiest and simplest way.

I did code ( following http://www.yiiframew...aching.overview) but it did not work.

Best,
Interboy
0

#2 User is offline   ORey 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 447
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 11 October 2012 - 06:51 AM

Not enough info for answering.
Born to create drama
0

#3 User is offline   Interboy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 31-August 11

Posted 11 October 2012 - 07:11 AM

View PostORey, on 11 October 2012 - 06:51 AM, said:

Not enough info for answering.


I'm newbie to code Caching in general.

I put fragment caching widget begin and end as the Yii guide, but it did not work. I do not know why.

So, as your experience in Yii, please tell by the best solution for caching and how to perform step by step.

Thank you so much,
Interboy
0

#4 User is offline   ORey 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 447
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 11 October 2012 - 07:49 AM

Have you set up the cache storage in config file?
Born to create drama
0

#5 User is offline   Interboy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 31-August 11

Posted 11 October 2012 - 10:05 AM

View PostORey, on 11 October 2012 - 07:49 AM, said:

Have you set up the cache storage in config file?


No. Do you mean we need config in main.php first?
In guide, What server1,2, port... I can put? I'm currently using shared hosting.



//main.php in config folder
array(
......
'components'=>array(
......
'cache'=>array(
'class'=>'system.caching.CMemCache',
'servers'=>array(
array('host'=>'server1', 'port'=>11211, 'weight'=>60),
array('host'=>'server2', 'port'=>11211, 'weight'=>40),
),
),
),
);
0

#6 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 646
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 11 October 2012 - 10:17 AM

You can start using CFileCache. It is simpler to setup.

If you have APC, you can use CApcCache.
You can also store the cached data in the database with CDbCache, if appropriate.

The configuration example on the guide is for CMemCache. For the other storage, you'll want to read its documentation (on the links above) and configure it accordingly.
Rodrigo Coelho


Check my extension
giix: a code generator for Yii. Posted Image


The complete beginner's study guide for the Yii Framework
0

#7 User is offline   Interboy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 31-August 11

Posted 13 October 2012 - 02:48 AM

Can you explain more? Or give me an example, it will help me a lot :)

View PostRodrigo Coelho, on 11 October 2012 - 10:17 AM, said:

You can start using CFileCache. It is simpler to setup.

If you have APC, you can use CApcCache.
You can also store the cached data in the database with CDbCache, if appropriate.

The configuration example on the guide is for CMemCache. For the other storage, you'll want to read its documentation (on the links above) and configure it accordingly.

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users