1

What is pros and cons of following code in configuration.php file?

public $memcache_persist = '1';
public $memcache_compress = '0';
public $memcache_server_host = 'localhost';
public $memcache_server_port = 'xxxx';
public $memcached_persist = '1';
public $memcached_compress = '0';
public $memcached_server_host = 'localhost';
public $memcached_server_port = 'xxxx';
public $session_memcache_server_host = 'localhost';
public $session_memcache_server_port = 'xxxx';
public $session_memcached_server_host = 'localhost';
public $session_memcached_server_port = 'xxxx';

I also have cache plugin enabled and as well as from global configuration.

public $caching = '1';
public $cache_handler = 'file';
public $cachetime = '720';

I am confused my hosting provider changed configuration file after switching to new server.

I just noticed and found memcache code in config file. What to do?

1 Answer 1

1

Joomla has built-in support for Memcached. Memcached can be activated by editing your configuration.php file, or from cPanel on certain hosting companies.

Two variants of Memcached can be enabled:

memcached
Uses the Memcached server to store sessions in RAM. Requires the memcached PHP extension. The server is configured like this:

public $memcache_persist = '0';
public $memcache_compress = '0';
public $memcache_server_host = '127.0.0.1';
public $memcache_server_port = '11211';

memcache
Uses the Memcached server to store sessions in RAM. Requires the memcache PHP extension. Using this extension is not recommended, 'memcached' is better. The memcached server configuration for Joomla 2.5+ is identical to the 'memcached' option above.

Note
It looks like both these options are enabled in your configuration.php file (both memchached and memcache). If you changed hosting company recently, it is possible the the new hosting company added one of the options without removing the other.

It doesn't sound like a good idea to enable both, I would suggest removing memcache and see if that affects anything. But please correct me if I'm wrong (if it's OK to use both).

You can read more on Memcached here: http://www.memcached.org/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.