Skip to content

Instantly share code, notes, and snippets.

@benclark
Created October 29, 2012 16:50
Show Gist options
  • Save benclark/3974821 to your computer and use it in GitHub Desktop.
Save benclark/3974821 to your computer and use it in GitHub Desktop.
Memcache config for settings.php (D6)
<?php
/**
* Memcache config
*/
// Check that one of the two memcache extensions are loaded.
if (extension_loaded('memcache') || extension_loaded('memcached')) {
if (!is_array($conf)) {
$conf = array();
}
// Change cache_inc to use the memcache backend.
$conf['cache_inc'] = './sites/all/modules/contrib/memcache/memcache.inc';
// Configure memcache servers.
$conf['memcache_servers'] = array(
'<<MEMCACHE SERVER GOES HERE>>:11211' => 'default',
);
// Configure memcache bins.
$conf['memcache_bins'] = array(
'cache' => 'default',
// Use database backend for these schema, as they frequently exceed the
// memcached insert size limit:
'cache_form' => 'database',
'cache_menu' => 'database',
'cache_page' => 'database',
'cache_views' => 'database',
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment