• 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

R

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

kuyenmotdivad

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

Code:
An unexpected exception occurred.
 

kuyenmotdivad

Well-known member
added this to my config, like this.

For example:
To activate Memcached Support add
PHP:
$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
     )
);
 
R

ragtek

Guest
Have you memcached installed?
Does the filecache work for you?
 

kuyenmotdivad

Well-known 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?
 

Blandt

Well-known 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?
If you have a VPS you might as well install it, even if it's small, get ready for when you grow.
 

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.
 

kuyenmotdivad

Well-known 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
 
R

ragtek

Guest
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
It seems, that you didn't install it;)
Have you added the needed infos into your php.ini?
 

Blandt

Well-known member
I use cpanel so I installed it aparently using EasyApache but it dont show on the phpinfo file for some reason.
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 ...
 
Top