1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. In order to post messages and view attached files in this forum, you must be a licensed XenForo customer.
    If you can't post, enter your forum username in the Associated Forum Users form in your customer area.

xcache config for dummies (like me)

Discussion in 'Server Configuration and Hosting' started by mrb1972, Mar 12, 2012.

  1. mrb1972 Active Member

    Can anyone tell me the best way to setup the cache setting in config for xcache, I dont really understand it to well, is it best to configure the Cache Front-end and Back-end or just one of them

    Any advise would be great

    thanks
  2. Slavik XenForo Moderator

    Configure or install?
  3. mrb1972 Active Member

    sorry I wasnt clear - its already installed on my sever, I just wasnt sure what was best to put in the xenforo config.php file
  4. Slavik XenForo Moderator

    $config['cache']['backend'] = 'xcache';
  5. mrb1972 Active Member

    What about the front-end?
  6. Brogan XenForo Moderator

  7. mrb1972 Active Member

    I have read that, but its not really clear if its best to have front and back configured or just back or just front - whats the best combo?
  8. Brogan XenForo Moderator

    I have this.

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['backend'] = 'File';
    $config['cache']['backendOptions'] ['cache_dir'] = '/path/to/cache';
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';
    I'm just using simple file caching though as I'm on a shared server.
    Adam Howard and mrb1972 like this.
  9. infis Well-Known Member

    I use this cache config in XenForo configuration for XCache:
    Code:
    $config['cache'] = array(
        'enabled' => true,
        'frontend' => 'Core',
        'frontendOptions' => array(
                'caching' => true,
                'automatic_serialization' => false,
                'cache_id_prefix' => 'you_prefix_',
                'lifetime' => 18000
        ),
        'backend' => 'Xcache',
        'backendOptions' => array(),
        'cacheSessions' => true
    );
    dspair, mrb1972 and Veer like this.
  10. gordy Well-Known Member

    When I set the cache to file I had thousands of files in my cache_dir.

    Adding this:

    Code:
    $config['cache']['backendOptions']['hashed_directory_level'] = '1';
    Put them all neatly into hash dirs decreasing seek and destroy times, something to consider if your site is active.
    infis likes this.
  11. Volion Active Member

    We are on a good sized VPS, however the host is telling us we cant use the caching feature because;

    To install one, they need to disable Automatic Updates, mod_suphp will be changed with mod_php and these are not recommended due to high security risks.

    Any suggestions?
  12. MattW Well-Known Member

    Do they just manage the VPS for you? Do you have any other sites on the VPS?

    I have a VPS, and to get Xcache working, I had to change from suPHP to FCGI for the PHP handler, as APC/Xcache doesn't work with suPHP.
  13. Volion Active Member

    Its managed, and it is the only site on the VPS.
  14. MattW Well-Known Member

    If it is the only site on the VPS, there is no need to be running suPHP, you can run in DSO (mod_php), and Xcache will work fine (as there is no one else on the site which could be exploited if your own site was hacked).

    http://boomshadow.net/tech/php-handlers/

    Are you running a control panel on the VPS (Cpanel or Plesk)?
  15. Volion Active Member

    Neither, its a custom CP, I wonder if I can just run this, if it would help any.
  16. MattW Well-Known Member

    File cache will work with suPHP
  17. Volion Active Member

    Thanks mate. :) Any problems with switching to file cache on busy site?

Share This Page