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

Breadcrumb

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

function SystemMessagesBlock::getCacheMaxAge

Overrides ContextAwarePluginTrait::getCacheMaxAge

File

core/modules/system/src/Plugin/Block/SystemMessagesBlock.php, line 44

Class

SystemMessagesBlock
Provides a block to display the messages.

Namespace

Drupal\system\Plugin\Block

Code

public function getCacheMaxAge() {
    // The messages are session-specific and hence aren't cacheable, but the
    // block itself *is* cacheable because it uses a #lazy_builder callback and
    // hence the block has a globally cacheable render array.
    return Cache::PERMANENT;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal