You are here

function ape_form_system_performance_settings_alter in Advanced Page Expiration 8

Same name and namespace in other branches
  1. 7 ape.module \ape_form_system_performance_settings_alter()

Implements hook_form_FORM_ID_alter().

  • Remove page_cache_maximum_age selection from main performance page and

instead direct users to this module's config page. Also do a little cleanup to clarify external caching.

File

./ape.module, line 36
Allows finer control of the Cache Control header.

Code

function ape_form_system_performance_settings_alter(&$form, FormStateInterface $form_state) {
  $form['caching']['page_cache_maximum_age']['#access'] = FALSE;
  $form['caching']['#description'] = Link::fromTextAndUrl(t('Configure page caching strategy with APE.'), Url::fromRoute('ape.admin'))
    ->toString();
}