Browse Source

no block caching for anonymous

2.x
Paul Pound 1 year ago
parent
commit
48ec54f7ee
  1. 11
      modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsArticles.php
  2. 11
      modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsBooks.php
  3. 11
      modules/solr_site/src/Plugin/Block/RoblibSearchSolrsiteBestbet.php
  4. 11
      modules/solr_site/src/Plugin/Block/RoblibSearchSolrsiteGeneral.php

11
modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsArticles.php

@ -39,4 +39,15 @@ class RoblibSearchEdsArticles extends BlockBase {
];
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
// Reading dynamic content from external source so no caching.
if (\Drupal::currentUser()->isAnonymous()) {
// Anonymous user...
return 0;
}
}
}

11
modules/roblib_search_eds/src/Plugin/Block/RoblibSearchEdsBooks.php

@ -39,5 +39,16 @@ class RoblibSearchEdsBooks extends BlockBase {
];
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
// Reading dynamic content from external source so no caching.
if (\Drupal::currentUser()->isAnonymous()) {
// Anonymous user...
return 0;
}
}
}

11
modules/solr_site/src/Plugin/Block/RoblibSearchSolrsiteBestbet.php

@ -37,4 +37,15 @@ class RoblibSearchSolrSiteBestbet extends BlockBase {
];
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
// Reading dynamic content from external source so no caching.
if (\Drupal::currentUser()->isAnonymous()) {
// Anonymous user...
return 0;
}
}:q
}

11
modules/solr_site/src/Plugin/Block/RoblibSearchSolrsiteGeneral.php

@ -39,4 +39,15 @@ class RoblibSearchSolrsiteGeneral extends BlockBase {
];
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
// Reading dynamic content from external source so no caching.
if (\Drupal::currentUser()->isAnonymous()) {
// Anonymous user...
return 0;
}
}
}

Loading…
Cancel
Save