function ViewsBlockBase::getCacheMaxAge

Overrides ContextAwarePluginTrait::getCacheMaxAge

File

core/modules/views/src/Plugin/Block/ViewsBlockBase.php, line 109

Class

ViewsBlockBase
Base class for Views block plugins.

Namespace

Drupal\views\Plugin\Block

Code

public function getCacheMaxAge() {
    $max_age = $this->view->display_handler
        ->getCacheMetadata()
        ->getCacheMaxAge();
    return Cache::mergeMaxAges(parent::getCacheMaxAge(), $max_age);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.