title: How to flush db query cache in yii2?
body: <p>How to handle it when some changes happen in specific table records ?</p>
  
  <pre><code>public static function getAirportWithCache($iata_code){
  
                $result = Airports::getDb()-&gt;cache(function ($db) use ($iata_code){
                       $res = Airports::find()
                                 -&gt;where(['iata_code' =&gt; $iata_code])
                                 -&gt;limit(1)
                                 -&gt;asArray()
                                 -&gt;one();
                       return $res;
                });
                return $result;
          }
  </code></pre>