Model Caching

Hi all,

Does Yii2 support model caching like Yii 1 ? How can we archive that ?

Thanks,

Dong

Have a look here, https://github.com/yiisoft/yii2/blob/master/docs/guide/caching.md

Thanks alex-w.

But I still wonder about this. For example I place these code in the query caching block

$user = User::find() -> all() ;

Will it get data from the cache the next time it execute that line of code. In Yii1 there is a way to save the model to the cache like : User::model()->cache() … Are these 2 style the same ?

Thanks,

I think they are different. I think the cache blocks are the same like in Yii 1.x the beginCache() and endCache() methods.