Commit 0e21df56 authored by webchick's avatar webchick

Issue #2232385 by Wim Leers: Cacheable 'Syndicate' block: never cache it,...

Issue #2232385 by Wim Leers: Cacheable 'Syndicate' block: never cache it, because it's cheaper to always render it.
parent 005025d1
......@@ -47,4 +47,27 @@ public function build() {
);
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, array &$form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
// @see ::isCacheable()
$form['cache']['#disabled'] = TRUE;
$form['cache']['#description'] = t('This block is never cacheable, it is not configurable.');
$form['cache']['max_age']['#value'] = 0;
return $form;
}
/**
* {@inheritdoc}
*/
public function isCacheable() {
// The 'Syndicate' block is never cacheable, because it is cheaper to just
// render it rather than to cache it and incur I/O.
return FALSE;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment