控制器:
//页面静态化(缓存)
public function behaviors()
{
return [
[
'class' => 'yiifiltersPageCache',
'only' => ['list'],
'duration' => 60,
'variations' => [
Yii::$app->language,
],
'dependency' => [
'class' => 'yiicachingDbDependency',
'sql' => 'SELECT COUNT(*) FROM yong',
],
],
];
}