1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Speed up your Board /caching

Discussion in 'Tips and Guides [Archive]' started by ragtek, Oct 8, 2010.

  1. ragtek

    ragtek Guest

    Zend Framework which is used in XenForo brings great Caching Methods with it.
    To see all available caching methods, check = http://framework.zend.com/manual/de/zend.cache.backends.html

    For example:
    To activate Memcached Support add
    PHP:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array('caching'   =>  true,
                                                
    'automatic_serialization' => true,
                                                
    'lifetime'    => 1800
    );
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
        
    'backendOptions'=>array(
                
    'servers' =>array(
                                array(
                                    
    'host' => 'localhost'// your memcached server ip /address
                                    
    'port' => 11211        // memcached port
                                
    )
                            ),
                 
    'compression' => false
         
    )
    );
    to your config.php


    Edit:
    For Filecache you can use something like:
    PHP:
    $config['cache']['enabled'] = true;

    $config['cache']['backend'] = 'File';
    $config['cache']['backendOptions'] = array('cache_dir'  => 'D:\xampp\xampp\htdocs\xf\upload\library\cache');



    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array('caching'   =>  true,
                                                
    'automatic_serialization' => true,
                                                
    'lifetime'    => 1800
    );
     
    krstep, Deceptor, Pyro and 2 others like this.
  2. kuyenmotdivad

    kuyenmotdivad Active Member

    I get this when adding the obove to my config.php file, any idea why?

    Code:
    An unexpected exception occurred.
     
  3. ragtek

    ragtek Guest

    What did you add to your config.php?
     
  4. kuyenmotdivad

    kuyenmotdivad Active Member

    added this to my config, like this.

     
  5. ragtek

    ragtek Guest

    Have you memcached installed?
    Does the filecache work for you?
     
  6. kuyenmotdivad

    kuyenmotdivad Active Member

    Yep, I get the same show with that as well. If I make a phpinfo file and search for mem or memcache it cant find it. I'm guessing it's not installed?

    Is memcache worth installing if I have a small forum?
     
  7. dmnkhhn

    dmnkhhn Active Member

    The Filecache works like a charm. :)
     
  8. Blandt

    Blandt Well-Known Member

    If you have a VPS you might as well install it, even if it's small, get ready for when you grow.
     
  9. Pyro

    Pyro Member

    There's also alternatives like APC, xcache etc. APC will probably be included in the PHP core when PHP 6 comes around, so that's what I've been using.

    I'd use something like APC if you just have a single VPS, and memcached if you're looking to setup some sort of load-balanced distributed solution.
     
    Blandt likes this.
  10. kuyenmotdivad

    kuyenmotdivad Active Member

    I installed memcache on my VPS but it keeps saying this and it don't show its loaded in a phpinfo file.

    Code:
    An exception occurred: The memcache extension must be loaded for using this backend ! in /home/xxxxx/public_html/community/library/Zend/Cache.php on line 209
    
    Zend_Cache::throwException() in Zend/Cache/Backend/Memcached.php at line 123
    Zend_Cache_Backend_Memcached->__construct() in Zend/Cache.php at line 153
    Zend_Cache::_makeBackend() in Zend/Cache.php at line 94
    Zend_Cache::factory() in XenForo/Application.php at line 513
    XenForo_Application->loadCache()
    call_user_func_array() in XenForo/Application.php at line 706
    XenForo_Application->lazyLoad() in XenForo/Application.php at line 736
    XenForo_Application::get() in XenForo/Model.php at line 146
    XenForo_Model->_getCache() in XenForo/Model/DataRegistry.php at line 76
    XenForo_Model_DataRegistry->getMulti() in XenForo/Dependencies/Abstract.php at line 133
    XenForo_Dependencies_Abstract->preLoadData() in XenForo/FrontController.php at line 125
    XenForo_FrontController->run() in /home/xxxxx/public_html/community/index.php at line 15
    
     
  11. Nonstopname

    Nonstopname Member

    how about xCache?
     
  12. I have eAccelerator installed on my server, any advice?
     
  13. ragtek

    ragtek Guest

    It seems, that you didn't install it;)
    Have you added the needed infos into your php.ini?
     
    Blandt likes this.
  14. ragtek

    ragtek Guest

  15. kuyenmotdivad

    kuyenmotdivad Active Member

    I use cpanel so I installed it aparently using EasyApache but it dont show on the phpinfo file for some reason.
     
  16. Blandt

    Blandt Well-Known Member

    Dave,
    run this command : php -i | grep memcache

    If it's installed you will get the ports, configuration and so on ....

    What linux distro are you running ? there are easier ways but it depends on what you're running ...
     
  17. Shamil

    Shamil Well-Known Member

    It's a shame ZF doesn't officially support WinCache at the moment.
     
  18. Nonstopname

    Nonstopname Member

    ragtek from your opinion, as for xenforo, which is the best memcached or xcache ?
     
  19. Deceptor

    Deceptor Active Member

    Thanks for the info Ragtek :)
     
  20. Shamil

    Shamil Well-Known Member

    It depends. For multi-server and load-balancing setup, try memcached. For a single server try XCache or APC.
     

Share This Page