hello
i've made some changes and though it would be nice to share ;)
the changes include:
- variable to turn on caching (false, no cache from cacherouter)
- detection of the module inc file (false, no crash)
- automatic path for domain (so the code will less likely need changes when adding to a new site. also good for multi-site environments built with symlinks)
/**
* Cache Router
*
* Cache API for Anonymous users, running on file, db, apc, xcache or memcache engines.
*/
$module_cacherouter_enabled = FALSE;
$module_cacherouter_inc = './sites/all/modules/performance/cacherouter/cacherouter.inc';
if ( file_exists($module_cacherouter_inc) && $module_cacherouter_enabled == TRUE ) {
$conf['cache_inc'] = $module_cacherouter_inc;
$conf['cacherouter'] = array(
'default' => array(
'engine' => 'file',
'servers' => array(),
'shared' => TRUE,
'prefix' => '',
'path' => 'sites/' . $_SERVER['SERVER_NAME'] . '/files/filecache',
'static' => FALSE,
'fast_cache' => FALSE,
),
);
}
posting a similar version for authcache module
Comments
Comment #1
lpalgarvio commentedauthcache suggestion here:
http://drupal.org/node/945656
Comment #2
tetramentis commentedMay I also suggest adding this (commented on purpose) line to your simplified configuration:
// 'lock_dir' => getcwd() . '/sites/' . $_SERVER['SERVER_NAME'] . '/files/filecache',This will complement my patch from #979462: using xcache: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid is X is not allowed to access /tmp.
Comment #3
tetramentis commentedComment #4
lpalgarvio commentedupdating to allow "default" domain
it would be useful to share this code in the docs for new users that are installing the module, with an advert that they need to change $module_cacherouter_default to "TRUE" to enable "default" domain, and that they need to change $module_cacherouter_enabled to "TRUE" to enable it the module altogether.
// EDIT
changed default behavior to set as "default" domain
and also module path
Comment #5
geekgirlweb commentedThanks for posting this, it was really helpful!
Comment #6
Krummrey commented#4 works for me
Comment #7
lpalgarvio commentednew version, with lots of changes.
placed file_exists in a IF iteration under the main IF iteration to reduce I/O when turned off.
for cache router (with support for bins):
for auth cache (with support for cache router and memcache):
Comment #8
lpalgarvio commentedchanged descriptions
Comment #9
lpalgarvio commentedchanged descriptions
Comment #10
lpalgarvio commentedComment #11
avpadernoI am closing this issue, since it is for a Drupal version that now is not supported.
Please re-open it if the issue is also relevant for other project branches that require a supported Drupal version.