Browse Source

no block caching for anonymous

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

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

@ -38,5 +38,16 @@ 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;
}
}
}

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

@ -38,6 +38,17 @@ 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;
}
}
}

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

@ -36,5 +36,16 @@ 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
}

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

@ -38,5 +38,16 @@ 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