function _acquia_purge_diagnostics_page_cache in Acquia Purge 7
Page cache.
Parameters
string $t: Name of the t() function to call.
AcquiaPurgeService $service: The Acquia Purge service.
Return value
array 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
 - ACQUIA_PURGE_SEVLEVEL_OK
 - ACQUIA_PURGE_SEVLEVEL_WARNING
 - ACQUIA_PURGE_SEVLEVEL_ERROR <-- blocks Acquia Purge from executing!
 
 
1 string reference to '_acquia_purge_diagnostics_page_cache'
File
- ./
acquia_purge.diagnostics.inc, line 741  - Diagnostic self-tests and reports that aim to prevent runtime misery.
 
Code
function _acquia_purge_diagnostics_page_cache($t, $service) {
  $cache = variable_get('cache', 0);
  $cache_backend = $service
    ->hostingInfo()
    ->getPageCacheBackend();
  $test = array(
    'severity' => ACQUIA_PURGE_SEVLEVEL_OK,
    'value' => $cache ? $t('Enabled (@b)', array(
      '@b' => $cache_backend,
    )) : $t('Disabled'),
    'title' => $t('Page cache'),
  );
  // See https://www.drupal.org/node/2330805
  if (!$cache && module_exists('authcache')) {
    $test['severity'] = ACQUIA_PURGE_SEVLEVEL_OK;
    $test['value'] = $t('Disabled (because of Authcache)');
  }
  elseif (!$cache) {
    $test['severity'] = ACQUIA_PURGE_SEVLEVEL_ERROR;
    $test['description'] = $t('Your site has Drupal page caching disabled,' . ' which is of extreme importance to every website that gets traffic.' . ' Once enabled your load balancer will be instructed to start serving' . ' pages from its cache to offload traffic from your web servers. The' . ' more traffic served from your load balancer, the faster your' . ' site will be!');
  }
  elseif ($service
    ->hostingInfo()
    ->isPageCacheFake()) {
    $test['value'] = $t("Enabled (DrupalFakeCache, executor disabled)");
  }
  elseif ($service
    ->oddities()
    ->has('wildcards')) {
    $test['severity'] = ACQUIA_PURGE_SEVLEVEL_WARNING;
    $test['description'] = $t('Your site invalidated one or more paths with' . ' wildcard characters in them in the past, e.g. "news/*". Because of' . ' this, you are now recommended to configure DrupalFakeCache as' . " documented on https://www.drupal.org/node/797346. If you don't do" . ' this, outdated cached copies will be returned from the page cache' . ' for paths you intended to clear with a wildcard.');
  }
  return $test;
}