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

Few questions about xenforo caching

Discussion in 'Server Configuration and Hosting' started by Moscato, Feb 18, 2015.

  1. Moscato

    Moscato Active Member

    What exactly is cached with
    $config['cache']['enabled'] = true;

    #2 How is that different from BD cache?

    Xenforo can use APC cache, memcached, or file cache

    I keep hearing APC has issues with 5.5+ so I'm going to cut that out as an option

    That leaves memcached and filecache (am I missing anything? Does it support redis?)

    Memcached is clearly faster than standard file cache because file cache is on disk while memcached is in ram

    What I would like to know, is memcached faster than tmpfs filecache?
    I'm primarily used to a wordpress environment and people consistently say tmpfs is faster than using memcached as a backend for pagecaching

    If not, on a single box, why would you use memcached?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Caching is explained here: https://xenforo.com/help/cache/

    Both frontend and backend are required.
    The frontend enables the cache, the backend defines the type.

    Opcache is for caching PHP's opcodes.
    The config.php cache entries are for caching data.

    Of the caching methods, I would recommend Memcached. If you're already using caching, you should specifically opt-in to session caching as well:
    $config['cache']['cacheSessions'] = true;
    With Memcached, cached data will be expunged when it expires (after lack of use) or when the memory is full (in a least-recently-used fashion).
  3. Moscato

    Moscato Active Member

    Are you suggesting the file cache method does NOT clear out old expired data?

    At this exact moment, I'm setup as:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    $config['cache']['cacheSessions'] = true;
    $config['cache']['backend'] = 'File';
    $config['cache']['backendOptions'] ['cache_dir'] = '/srv/http/techraptor/community/file_cache';

    that filecache is sitting on tmpfs

    Reading this is what made me wonder about it, as tmpfs has been reported to being 30 times faster than memcached
    shm is another term for tmpfs

    I still am a bit confused as to what actually is being cached
  4. Fred.

    Fred. Well-Known Member

    I'm using Memcached, or Libmemcached to be more specific.
    When I enable cacheSessions I just get a white page. Without it it works perfect.
    Any idea?
  5. Brogan

    Brogan XenForo Moderator Staff Member

    I seem to recall something about Libmemcached, my memory's a bit hazy though.

    It might be worth doing a search.
  6. Fred.

    Fred. Well-Known Member

  7. Marcus

    Marcus Well-Known Member

  8. Marcus

    Marcus Well-Known Member

    I use the pecl memcached extension (not the pecl memcache extension) and just entered "Libmemcached" as the backend cache within config.php, and it works great with sessions, too. I did not have to change any values in my configuration.

    Usually names with a "d" at the end are a sign that these programs work like a "daemon". That's not the case with this extension, it is just a newer pecl client extension for memcache. When I installed it on my server, libmemcached was also installed automatically.
  9. Moscato

    Moscato Active Member

    Anyone know:
    What exactly is cached with
    $config['cache']['enabled'] = true;
  10. Marcus

    Marcus Well-Known Member

    I guess $config['cache']['enabled'] = false; will globally disable any cache (frontend and backend). I don't know much more about how cache system works unfortunately.

Share This Page