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

xcache config for dummies (like me)

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

  1. mrb1972

    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

  2. Slavik

    Slavik XenForo Moderator Staff Member

    Configure or install?
  3. mrb1972

    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

    Slavik XenForo Moderator Staff Member

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

    mrb1972 Active Member

    What about the front-end?
  6. Brogan

    Brogan XenForo Moderator Staff Member

  7. mrb1972

    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

    Brogan XenForo Moderator Staff Member

    I have this.

    $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

    infis Well-Known Member

    I use this cache config in XenForo configuration for XCache:
    $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
    dwdmadmac, Adam Howard, Fred. and 4 others like this.
  10. gordy

    gordy Well-Known Member

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

    Adding this:

    $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.
    Jattitude and infis like this.
  11. Volion

    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

    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

    Volion Active Member

    Its managed, and it is the only site on the VPS.
  14. MattW

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


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

    Volion Active Member

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

    MattW Well-Known Member

    File cache will work with suPHP
  17. Volion

    Volion Active Member

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

    Parminder Singh Chahal Active Member

    The security risk statement would be true if it was a server that was being used to provide hosting to a number of customers but if the VPS is being used just for your own websites then I dont see how it would pose a security risk.

    I use DSO and I feel its a little faster then other handlers and I use APC with it. It does make it harder to pin point where the problem is is you have your server stretched at peak times but thats one reason why its faster amongst others. It goes very well with APC or Xcache. I use APC. If you want to keep things simple and have a little extra RAM to spare then go with FCGI.

    Most server management companies would tell you the same thing that it would be a security risk which is correct in a shared environment as people could dos each others cache and make page loads even slower and even wipe out each others caches from the RAM but these things mean nothing if its not a shared server. Server management companies get very few customers like us lot who are not hosting companies and use the servers for their own sites.

    Thats what I understand and I am not always right ;) Some one please correct me if I am wrong :)
  19. estranged

    estranged Well-Known Member

    You can use dso and get speed+security at the same time by using mod_ruid

    It is similar to suphp in terms of security. Not as secure as suphp but more secure than mod_php. You can also use caches with it unlike suphp

    I'm using mod ruid + xcache on my server for a long time. It is fast because it is dso and I have no problems so far.
  20. MattW

    MattW Well-Known Member

    I set @Volion up with mod_ruid2 and Xcache a few months back now. No issues with it, and I've had it on my server for almost 18 months.

Share This Page