Answer the question
In order to leave comments, you need to log in
Yii2 cache not caching queries with aggregate functions?
Queries like this are not cached
$minValue = (new Query())->cache(3600)->from(...)->min(...);
$minValue = Yii::$app->db->cache(
function ($db) {
return (new Query())->from(...)->min(...);
},
3600
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question