Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Fast404ExceptionHtmlSubscriber.php

function Fast404ExceptionHtmlSubscriber::onConfigSave

Invalidates 4xx-response cache tag if fast 404 config is changed.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The configuration event.

File

core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php, line 114

Class

Fast404ExceptionHtmlSubscriber
High-performance 404 exception subscriber.

Namespace

Drupal\Core\EventSubscriber

Code

public function onConfigSave(ConfigCrudEvent $event) : void {
    $saved_config = $event->getConfig();
    if ($saved_config->getName() === 'system.performance' && $event->isChanged('fast_404')) {
        $this->cacheTagsInvalidator
            ->invalidateTags([
            '4xx-response',
        ]);
    }
}
RSS feed
Powered by Drupal