• While creating requests or asking for support in the existing XenForo threads please maintain XenForo support policy strictly.

  • You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

[HELP] XenForo 2.1 Caching

CAFFEiNE

Well-known member
Trusted Uploader
Oct 16, 2019
510
344
63
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;
 
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: CAFFEiNE
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.
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock