📜 ⬆️ ⬇️

Accelerate XenForo: enable caching

By default, caching in XenForo is disabled. Caching is done using the Zend Framework, so a wide variety of caching systems are available. And it's very easy to turn it on.


Turn on



To enable it, add the following to /library/config.php:
$config['cache']['frontend'] = 'Core'; $config['cache']['frontendOptions'] = array('caching' => true, 'automatic_serialization' => true, 'lifetime' => 1800 ); 

Help frontendOptions.
')
Next we need to choose which caching mechanism to use. Add to config.php the configuration we need:

Memcached:


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


APC:


 $config['cache']['backend'] = 'Apc'; $config['cache']['backendOptions'] = array(); 


File system:


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

Of course, the directory must be writable.

Help on backend caching system.

Source: https://habr.com/ru/post/105992/


All Articles