// START Redis configuration //
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xfredis_';
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
'server' => '127.0.0.1',
'port' => 6379,
'connect_retries' => 2,
'use_lua' => true,
'compress_data' => 6,
'read_timeout' => 1,
'timeout' => 1,
'serializer' => 'igbinary',
// 'serializer' => 'php',
'persistent' => true,
);
// END Redis configuration //
// START Guest page caching //
$config['pageCache']['enabled'] = true;
$config['cache']['context']['page']['provider'] = 'Redis';
$config['cache']['context']['page']['config'] = [
'host' => '127.0.0.1',
'port' => 6379,
'persistent' => true,
'serializer' => 'igbinary',
'database' => 1,
'use_lua' => true
];
// END Guest page caching //
// START CSS caching //
$config['cache']['context']['css'] = [
'namespace' => 'sv',
'provider' => 'SV\RedisCache\Redis',
'config' => [
'server' => '127.0.0.1',
'port' => 6379,
],
];
// END CSS caching //
// START Mobile detection with full page caching //
$config['pageCache']['onSetup'] = function (\XF\PageCache $pageCache) {
$pageCache->setCacheIdGenerator(function(\XF\Http\Request $request) {
return \SV\BrowserDetection\CacheHelper::getPageCacheId($request);
});
};
// END Mobile detection with full page caching //