You are here

README.txt in APC - Alternative PHP Cache 7

1. Installation
2. Testing

/*****************
 * 1. Installation
 ****************/
- Step 1
Enable the module and make sure the APC extension is installed properly on
the status page (http://yoursite/admin/reports/status).

Step two is important to think about because it can make your site faster
or slower depending on the right configuration. APC normally has a limited
memory allocation (32M) and should be used to cache the entries which are 
used most since it's the cache closest (and maybe fastest) to PHP. When 
the memory allocated by APC is big enough to cache the entire drupal
cache (to do so check the size of the cache_% tables in the database when
the cache is hot) you can use Step2b, if not use step 2a.

- Step 2a
Add the following code to your settings.php file:

/**
 * Add APC Caching.
 */
$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
//$conf['apc_show_debug'] = TRUE;  // Remove the slashes to use debug mode.

- Step 2b
Add the following code to your settings.php file:

/**
 * Add APC Caching.
 */
$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_default_class'] = 'DrupalAPCCache';
//$conf['apc_show_debug'] = TRUE;  // Remove the slashes to use debug mode.

- Step 3
Visit your site to see or it's still working!

- Step 4 (OPTIONAL)
When using DrupalAPCCache as default or manually caching the 'cache_page' bin
in your settings file you do not need to start the database because Drupal can
use the APC cache for pages. Add the following code to your settings.php file
to do so:

$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;

- Step 5 (OPTIONAL)
Visit your site to see or it's still working!


/*****************
 * 2. Testing
 ****************/
To be able to test this module open DRUPAL_ROOT/includes/cache.inc and search
for `variable_get('cache_default_class', 'DrupalDatabaseCache')`. and change
this to DrupalAPCCache. This is because the $conf[''] array in settings.php
is not always loaded properly.

File

README.txt
View source
  1. 1. Installation
  2. 2. Testing
  3. /*****************
  4. * 1. Installation
  5. ****************/
  6. - Step 1
  7. Enable the module and make sure the APC extension is installed properly on
  8. the status page (http://yoursite/admin/reports/status).
  9. Step two is important to think about because it can make your site faster
  10. or slower depending on the right configuration. APC normally has a limited
  11. memory allocation (32M) and should be used to cache the entries which are
  12. used most since it's the cache closest (and maybe fastest) to PHP. When
  13. the memory allocated by APC is big enough to cache the entire drupal
  14. cache (to do so check the size of the cache_% tables in the database when
  15. the cache is hot) you can use Step2b, if not use step 2a.
  16. - Step 2a
  17. Add the following code to your settings.php file:
  18. /**
  19. * Add APC Caching.
  20. */
  21. $conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
  22. $conf['cache_class_cache'] = 'DrupalAPCCache';
  23. $conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
  24. //$conf['apc_show_debug'] = TRUE; // Remove the slashes to use debug mode.
  25. - Step 2b
  26. Add the following code to your settings.php file:
  27. /**
  28. * Add APC Caching.
  29. */
  30. $conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
  31. $conf['cache_default_class'] = 'DrupalAPCCache';
  32. //$conf['apc_show_debug'] = TRUE; // Remove the slashes to use debug mode.
  33. - Step 3
  34. Visit your site to see or it's still working!
  35. - Step 4 (OPTIONAL)
  36. When using DrupalAPCCache as default or manually caching the 'cache_page' bin
  37. in your settings file you do not need to start the database because Drupal can
  38. use the APC cache for pages. Add the following code to your settings.php file
  39. to do so:
  40. $conf['page_cache_without_database'] = TRUE;
  41. $conf['page_cache_invoke_hooks'] = FALSE;
  42. - Step 5 (OPTIONAL)
  43. Visit your site to see or it's still working!
  44. /*****************
  45. * 2. Testing
  46. ****************/
  47. To be able to test this module open DRUPAL_ROOT/includes/cache.inc and search
  48. for `variable_get('cache_default_class', 'DrupalDatabaseCache')`. and change
  49. this to DrupalAPCCache. This is because the $conf[''] array in settings.php
  50. is not always loaded properly.