You are here

function _acquia_purge_get_diagnosis_page_cache in Acquia Purge 6

Test if anonymous page caching is enabled.

@returns Associative array with the following elements:

  • title: The name of the requirement.
  • value: The current value (e.g., version, time, level, etc).
  • description: The description of the requirement/status.
  • severity: ACQUIA_PURGE_SEVLEVEL_INFO, _OK, _WARNING, _ERROR

Parameters

string $t: Name of the t() function to call.

File

./acquia_purge.diagnostics.inc, line 223
Self-test diagnostic test functions for _acquia_purge_get_diagnosis().

Code

function _acquia_purge_get_diagnosis_page_cache($t) {
  $cache = intval(variable_get('cache', 0)) === 3;
  $test = array(
    'severity' => ACQUIA_PURGE_SEVLEVEL_OK,
    'value' => $cache ? $t('External') : $t('Not in External mode'),
    'title' => $t('Cache pages for anonymous users'),
  );
  if (!$cache) {
    $test['severity'] = ACQUIA_PURGE_SEVLEVEL_ERROR;
    $test['description'] = $t('Your site has Drupal page caching disabled, in,' . ' normal mode or in aggressive mode. However the only mode supported' . ' and effective on Acquia Cloud is the external caching. It is of' . ' extreme importance to every site getting traffic. Once put in' . ' external mode (Pressflow) your load balances will be instructed to' . ' serve pages from its cached and protect your site and web servers.' . ' The more traffic offloaded to your balancers, the faster your site' . ' will be!');
  }
  return $test;
}