How correctly cache results of ActiveDataProvider for GridView for large tables?
Gii generates code like:
public function search($params)
{
$query = Post::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'status' => $this->status,
'type' => $this->type,
'public_date' => $this->public_date,
]);
$query->andFilterWhere(['like', 'title', $this->title])
->andFilterWhere(['like', 'full_content', $this->full_content])
return $dataProvider;
}
Thanks!