[HELP] XenForo 2.1 Caching

the_jester

Active member
Trusted Uploader
Oct 16, 2019
368
189
43
A friend of mine is working on a XenForo 2.1 forum and has run into a slight issue. Basically, what he wants is for Memcached to cache the entire site for guests and logged in users. He doesn't want separate caches for guests and logged in users. He figured that if he caches everything, the site will be fast for guests browsing the forum and for the registered users.

From the below sets of codes, what should be added or changed to achieve the goal of caching the entire site for everyone?

CODE 1:
PHP:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Memcached';
$config['cache']['config'] = [
    'server' => '127.0.0.1'
];

$config['cache']['context']['CONTEXT_NAME']['provider'] = 'Memcached';
$config['cache']['context']['CONTEXT_NAME']['config'] = [];


$config['cache']['enabled'] = true;
$config['pageCache']['enabled'] = true;
$config['cache']['context']['page']['provider'] = 'Memcached';
$config['cache']['context']['page']['config'] = [];

CODE 2:
PHP:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array(
    'caching'                  => true,
    'automatic_serialization'  => true,
    'lifetime'                  => 1800,
    'cache_id_prefix'          => 'xxx_xf'
);
#backend
#Memcached
$config['cache']['backend']='Memcached';
$config['cache']['backendOptions']=array(
      'compression'=>false,
      'servers' => array(
              array(
                  'host'=>'127.0.0.1',
                  'port'=>11211,
              )
        )
);
$config['cache']['cacheSessions'] = true;
 

phaze1G

Member
Aug 30, 2019
45
13
8
Try this
PHP:
PHP:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'XXX_';
$config['cache']['config'] = [
    'servers' => [
        ['localhost', 11211]
    ]
];
$config['cache']['provider'] = 'Memcached';
 
  • Like
Reactions: the_jester

the_jester

Active member
Trusted Uploader
Oct 16, 2019
368
189
43
Try this
PHP:
PHP:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'XXX_';
$config['cache']['config'] = [
    'servers' => [
        ['localhost', 11211]
    ]
];
$config['cache']['provider'] = 'Memcached';
Thank you for the response. I will ask him to test this code and report back.
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu