• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 How to setup caching

NeoCHI

Active member
#1
So if I'm understanding this correctly, all I need to do to setup caching for my xf site is to install memcache and then just add:
Code:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
$config['cache']['frontendOptions']['automatic_serialization'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['backend']='Memcached';
$config['cache']['backendOptions']=array(
        'compression'=>false,
        'servers' => array(
                array(
                        'host'=>'127.0.0.1',
                        'port'=>'11211',
                        'persistent' => 'true'
                )
      )
);
to my config.php?

Then afterwards I should enable "Minify CSS" and "Fetch public templates as files"?

Also, how can I check if my caching is setup correctly afterwards?
 

Mike

XenForo developer
Staff member
#2
That should generally work.

CSS minification requires caching to be enabled, but putting the templates in files doesn't. Putting the templates in files is mostly just useful if you have an opcode cache.

The caching really should just be working, but you can verify if you enable debug mode and compare some of the initial queries between with and without the cache.
 

Mike

XenForo developer
Staff member
#4
Effectively, one holds data that is explicitly given to it (a (data) cache) and the other holds compiled PHP code (opcode cache). They're wholly independent of each other. Example opcode caches would be APC and the built-in (in 5.6) opcache.