' . t('About') . ''; $output .= '

' . t('The Internal page cache module caches pages for anonymous users in the database.') . '

'; $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Speeding up your site') . '
'; $output .= '
'; $output .= '

' . t('Pages requested by anonymous users are stored the first time they are requested and then reused; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, the caching system may significantly increase the speed of your site.'); $output .= '

' . t('(For authenticated users, pages need to be assembled for each user individually, but anonymous users all get the exact same version of each page.)') . '

'; $output .= '
'; $output .= '
' . t('Configuring Internal page cache') . '
'; $output .= '
'; $output .= '

' . t('On the Performance settings page, you can configure how long browsers and proxies may cache pages, that setting is also respected by the Internal page cache module. There is no other configuration.', array('@cache-settings' => \Drupal::url('system.performance_settings'))) . '

'; $output .= '
'; $output .= '
'; return $output; } } /** * Implements hook_form_alter(). */ function page_cache_form_alter(&$form, FormStateInterface $form_state, $form_id) { // If the page that's being built is cacheable, set the 'immutable' flag, to // ensure that when the form is used, a new form build ID is generated when // appropriate, to prevent information disclosure. $request_policy = \Drupal::service('page_cache_request_policy'); $request = \Drupal::requestStack()->getCurrentRequest(); $request_is_cacheable = $request_policy->check($request) === RequestPolicyInterface::ALLOW; if ($request_is_cacheable) { $form_state->addBuildInfo('immutable', TRUE); } }