XF 2.1 Guest page caching

JoyFreak

Well-known member
So I have this in my config already:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
'host' => '127.0.0.1',
'password' => 'Boobs!'
];


Do I just need to simply add this in the end?
$config['pageCache']['enabled'] = true;
 
Would the use of Xon's Redis cache allow the use of both regular caching and guest page caching (each configured to use a separate DB) without having to create a second instance of Redis or would a second instance be required no matter what Redis cache is implemented (stock or Xon's)?
 
Both stock/xon's can use one or multiple databases.
Creating multiple instances is optional in both too.
I get that it's optional but per the earlier conversation in this thread it's not recommended to use a single instance. Does @Xon's implementation resolve that recommendation?
 
Does @Xon's implementation resolve that recommendation?

No, both implementations interact with Redis.
You don't have to use multiple databases or multiple instances.

It all depends if the number pages you are caching, the cache lifetime and the number of guests visitors.

I've used one instance with 3 databases and Redis unlimited memory.
I just keep an eye on the stats to get the real picture for one week and now I know how much memory I can give to Redis.
 
What is your concern?
The exact same concern that you pointed out earlier. ;)
Just be aware of this Mike's comment about sharing the same cache instance:

 
That's why I've measured for a week the amount of memory used with differents lifetime caching until I got the average and max memory used for that week.

After that I know for my use case what configuration works best for me and I don't need to have multiple instances of Redis, but Mike's advise is valid and should be considered.

There isn't a perfect way of doing this that's why I suggest you to measure and decide.
 
I have this config

Code:
// Cache
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = [
    'server' => '127.0.0.1',
    'port' => 6379,
];
// Cache

// Guest Full Page Cache
$config['pageCache']['enabled'] = true;
// Guest Full Page Cache

uT40JZy.png



This is no "X-XF-Cache-Status: HIT " response
 
I have three Xenforo sites on the same server using the following configs for each of the sites. It seems to be working, and I am getting a "X-XF-Cache-Status: HIT " response on all.

Is there anything wrong or missing in my setup?

Site 1:
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
    'database' => 1,
    'host' => '127.0.0.1'
];

$config['pageCache']['enabled'] = true;
$config['pageCache']['recordSessionActivity'] = false;
$config['pageCache']['lifetime'] = 900;
$config['cache']['context']['page']['provider'] = 'Redis';
$config['cache']['context']['page']['config'] = [
    'database' => 2,
    'host' => '127.0.0.1'
];

Site 2:
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
    'database' => 3,
    'host' => '127.0.0.1'
];

$config['pageCache']['enabled'] = true;
$config['pageCache']['recordSessionActivity'] = false;
$config['pageCache']['lifetime'] = 900;
$config['cache']['context']['page']['provider'] = 'Redis';
$config['cache']['context']['page']['config'] = [
    'database' => 4,
    'host' => '127.0.0.1'
];

Site 3:
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config'] = [
    'database' => 5,
    'host' => '127.0.0.1'
];

$config['pageCache']['enabled'] = true;
$config['pageCache']['recordSessionActivity'] = false;
$config['pageCache']['lifetime'] = 900;
$config['cache']['context']['page']['provider'] = 'Redis';
$config['cache']['context']['page']['config'] = [
    'database' => 6,
    'host' => '127.0.0.1'
];
 
Back
Top Bottom