XF 1.4 How to setup caching


Active member
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:
$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;
        'servers' => array(
                        '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?


XenForo developer
Staff member
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.


XenForo developer
Staff member
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.