function _prod_check_page_cache in Production check & Production monitor 7
Same name and namespace in other branches
- 6 prod_check.module \_prod_check_page_cache()
File
- ./
prod_check.module, line 1001
Code
function _prod_check_page_cache($caller = 'internal') {
$check = array();
$error = FALSE;
$title = 'Cache pages for anonymous users';
$path = 'admin/config/development/performance';
if ($caller != 'internal') {
$path = PRODCHECK_BASEURL . $path;
}
if (variable_get('cache', 0) == 0) {
$error = TRUE;
// Maybe Boost is enabled?
if (variable_get('boost_enabled', 0) == 1) {
$error = FALSE;
$path .= '/boost';
}
}
$check['prod_check_page_cache'] = array(
'#title' => t($title),
'#state' => !$error,
'#severity' => $caller == 'nagios' ? NAGIOS_STATUS_CRITICAL : PROD_CHECK_REQUIREMENT_ERROR,
'#value_ok' => t('Enabled'),
'#value_nok' => t('Disabled'),
'#description_ok' => prod_check_ok_title($title, $path),
'#description_nok' => t('Your !link settings are disabled. You should at least set page caching to "Cache pages for anonymous users" on a production site! You should also consider using the !boost module or a more powerful system like !varnish!', array(
'!link' => '<em>' . l(t($title), $path, array(
'attributes' => array(
'title' => t($title),
),
'query' => drupal_get_destination(),
)) . '</em>',
'!boost' => '<em>' . l(t('Boost'), 'http://drupal.org/project/boost', array(
'attributes' => array(
'title' => t('Boost'),
),
)) . '</em>',
'!varnish' => '<em>' . l(t('Varnish'), 'http://drupal.org/project/steroids', array(
'attributes' => array(
'title' => t('Varnish'),
),
)) . '</em>',
)),
'#nagios_key' => 'PCACHE',
'#nagios_type' => 'state',
);
return prod_check_execute_check($check, $caller);
}