2011-04-03 17:58:24 0 评论 Yii 1.0 Boy.Lee

Yii 1.0 使用 Cache

{Methods}

There are three methods in Yii for cache, normal cache, fregment cache, and page cache.

{Code Example}

here is the link

{Boy Say}

EN : follow the code demo, everything is easy to use, the only thing u need to do is choose one and make some change.

set duration for the time to duration.

set dependency for a sepcial rule to keep cache update or die

set varyByParam to decide which will be deferent cache in the same url

CN : 在你的代码里使用缓存是非常容易的,你只需要选择一种类型,然后做适当的修改。duration表示持续时间,dependency表示更新依赖关系,varyByParam表示一个独立的缓存关系,比如说针对不同的id建立缓存。

{Link more detail} http://www.yiiframework.com/doc/guide/1.1/en/caching.overview