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

Defining A Cache - What's The Point?

Discussion in 'XenForo Questions and Support' started by DRE, Sep 1, 2012.

  1. DRE

    DRE Well-Known Member

    Is my forum large enough to warrant defining a cache? http://xenforo.com/help/cache/

    Question I asked my host just now.

    Q: Hi with this Dedicated Server does caching features come with it? I would like to define a cache to help enhance the site's performance and loading time.

    A: You are located on a semi-dedicated hosting plan which is not a dedicated server. That said, you should be able to configure XenForo to use a file cache as described on that help document. The APC and Memcached options are not supported.

    ^^^So according to him, all I should use via the help document is this part?

    Cache Front-End

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_'; 
    File Back-End

    Code:
     $config['cache']['backend'] = 'File'; 
    ^^^That's all I need right?
     
  2. DRE

    DRE Well-Known Member

  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    At the very least I recommend installing APC in your PHP configuration. APC speeds up execution without requiring any special configuration in XenForo. Just install APC on your server and that's it.

    Beyond that you can also setup a memory cache which requires more effort and configuration. See my post here:

    http://xenforo.com/community/threads/xenforo-plus-apc-plus-memcache.34985/#post-397405

    And Naatan's post is a good one regarding setting up a memory cache:

    In short, just install APC. Don't bother with a memory cache.
     
  4. ibaker

    ibaker Well-Known Member

    I have a dedicated server that is managed by an outside server management company...how can I check if APC is installed and working?
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Install the status script so you can view the state of the cache:

    http://drupal.org/project/apc_status
     
  6. ibaker

    ibaker Well-Known Member

    Thanks Jake
    I have lodged a support ticket with my server mgmt to install APC...the monitoring page you have provided a link for is for Drupal or does that not matter...I would guess that I would be able to call the page up from my WHM panel?
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The status script should come with APC when you install it.
     
  8. ibaker

    ibaker Well-Known Member

    Thanks Jake, I have just been informed by my server mgmt that APC is now installed.

    So can I please confirm what I need to do now...I add:
    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    // $config['cache']['cacheSessions'] = true;
    to the config file

    But what do I do about the backend?
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    APC is normally used as an opcode cache which doesn't require any configuration in XenForo. It just automatically works by storing the compiled versions of PHP files. An opcode cache yields significant performance benefit without any special configuration in XenForo. xenforo.com uses APC.

    Configuration is only required for a memory cache (to store the data registry and session records in shared memory). A memory cache can shave off a couple of queries on each page which can be significant on busy forums, but it also requires more effort to setup.
     
  10. ibaker

    ibaker Well-Known Member

    So I do nothing other then just have it installed...thanks Jake
     
  11. ibaker

    ibaker Well-Known Member

    I had my server mgmt people install APC and now my error log file in my XF root directory is being bombarded with errors saying:
    [26-Sep-2012 04:43:07 UTC] PHP Warning: PHP Startup: apc.shm_size now uses M/G suffixes, please update your ini files in Unknown on line 0
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    http://syslint.com/syslint/php-warn...ses-mg-suffixes-please-update-your-ini-files/

     
    MattW and CyclingTribe like this.
  13. ibaker

    ibaker Well-Known Member

    As always, thanks Jake...all fixed now
     
    CyclingTribe likes this.

Share This Page