1. 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

Discussion in 'XenForo Questions and Support' started by NeoCHI, Mar 12, 2015.

  1. NeoCHI

    NeoCHI 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?
  2. Mike

    Mike 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.
  3. NeoCHI

    NeoCHI Active Member

    what's the difference between caching and opcode cache?
  4. Mike

    Mike 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.

Share This Page