Answer the question
In order to leave comments, you need to log in
Explain how query caching works in Yii?
Here is a piece from the documentation
$dependency = new CDbCacheDependency('SELECT MAX(update_time) FROM tbl_post');
$posts = Post::model()->cache(1000, $dependency)->findAll();
// реляционный запрос
$posts = Post::model()->cache(1000, $dependency)->with('author')->findAll();
Answer the question
In order to leave comments, you need to log in
He answered off the forum
I understood everything correctly.
1000 is the cache lifetime
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question