How to cache ActiveRecord query

Hi,

I’m trying to cache ActiveRecord query, for example:

$searchModel = new ReportSearch();

$searchModel->find()->where([‘code’ => ‘aaa’])->all();

I can’t figure it out, please help :)

anybody? :)

You can read about query caching and apply it to your AR use case.