How to enable guest page caching [Deleted]

Jean-Baptiste

Well-known member
Jean-Baptiste submitted a new resource:

How to enable guest page caching - How to enable guest page caching in XenForo 2.1

With the latest XenForo 2.1 version, you can enable a guest page page caching, that can reduce your server load.

To enable it, add the following code in your src/config.php file :

Code:
// guest page caching.
$config['pageCache'] = array();
$config['pageCache']['enabled'] = true;
$config['pageCache']['lifetime'] = 300...

Read more about this resource...
 
No, it's not disabled. The explanation is wrong though. It suggests setting things that aren't necessary (though you can override them if necessary) and the code edit is 100% incorrect.

You need to specifically specify where you're putting page cache data. It's unlikely that you want to store it with other data, as it will likely reduce the use of that cache. To do that, you specify something like:

Code:
$config['cache']['context']['page'] = [
        'provider' => 'Memcached',
        'config' => ['server' => '127.0.0.1']
];

Change the provider and config to suit. Then you just need to enable page caching:

Code:
$config['pageCache']['enabled'] = true;

(Assuming global caching is also enabled.)

The other lines only need to be set if you wish to change their values.

We'd have to ask that you update the resource to the "correct" approach, or we'd likely want to delete it for being incorrect. Note that this sort of information will go into our manual when 2.1 is closer to stable.
 
Note that this sort of information will go into our manual when 2.1 is closer to stable.
I didn't found this on Manual Page.
Is this code correct?
Or something is redundant?

PHP:
// Cache
$config['cache']['sessions'] = true;
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
    'host' => '127.0.0.1',
    'database' => 2,
    'persistent' => true,
    'persistent_id' => 'pre_'
];
// Cache

// Guest Full Page Cache
$config['cache']['context']['page'] = [
        'provider' => 'Redis',
        'config' => ['server' => '127.0.0.1']
];
$config['pageCache']['enabled'] = true;
// Guest Full Page Cache
 
Back
Top Bottom