How to use ActiveRecotd cache for Yii 2? I did\'t find any examples in official docs. In Google I found 2 examples, first is:
$db = self::getDb(); $object =
Since 2.0.14 you can use the following shortcuts:
(new Query())->cache(7200)->all(); // and User::find()->cache(7200)->all();
Source: https://www.yiiframework.com/doc/guide/2.0/en/caching-data