I’ve just started looking at Page Cache variations and am having a few problems.
I have 4 actions, each which can take a variety of input parameters and even a POST, along the lines of update?id=xx, view?ref=xx, book(POST id=xx)
So how should you setup variations for each set of parameters
I have a behavior as follows:-
'pageCache' => [
'class' => 'yii\filters\PageCache',
'except' => ['related'],
'only' => (YII_DEBUG) ? ['dummy'] : [],
'duration' => 3600,
'dependency' => [
'class' => 'yii\caching\DbDependency',
'sql' => 'SELECT MAX(last_updated) FROM properties',
],
'variations' => [
Yii::$app->request->isAjax,
(isset($_GET['ref']))? $_GET['ref'] : '',
(isset($_POST['ref']))? $_POST['ref'] : '',
(isset($_GET['id']))? $_GET['id'] : ''
]
],
but this returns ‘Database gone away’ errors on some actions.