public function behaviors() {
return [
'HttpCache' => [
'class' => 'yii\filters\HttpCache',
'lastModified' => function ($action, $params) {
$model = \app\models\Products::findOne($_GET['id']);
$time = (empty($model->time_edit))?$model->time_add:$model->time_edit;
return $time;
},
],
];
}