use Model::find() returns resultset,and I can use resultset->isFresh() to get if resultset is cached!
but findFirst returns resultset->getFirst() and cannot call isFresh method,so I dont know findFirst gets from cache or from db directly?
let result = cache->get(key, lifetime); if result !== null { if typeof result != "object" { throw new Exception("Cache didn't return a valid resultset"); } result->setIsFresh(false); /** * Check if only the first row must be returned */ if uniqueRow { let preparedResult = result->getFirst(); } else { let preparedResult = result; } return preparedResult; }