Loading src/Plugin/facets/hierarchy/DateItems.php +3 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\facets\Plugin\facets\hierarchy; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\facets\Hierarchy\HierarchyPluginBase; /** Loading @@ -15,6 +16,8 @@ use Drupal\facets\Hierarchy\HierarchyPluginBase; */ class DateItems extends HierarchyPluginBase { use UnchangingCacheableDependencyTrait; /** * Static cache for the parents. * Loading src/Plugin/facets/processor/TermWeightWidgetOrderProcessor.php +2 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; Loading Loading @@ -133,7 +134,7 @@ class TermWeightWidgetOrderProcessor extends SortProcessorPluginBase implements * {@inheritdoc} */ public function getCacheTags() { return ['taxonomy_term:list']; return Cache::mergeTags(parent::getCacheTags(), ['taxonomy_term_list']); } } src/Plugin/facets/processor/TranslateEntityAggregatedFieldProcessor.php +17 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Config\ConfigManagerInterface; Loading Loading @@ -32,8 +31,6 @@ use Drupal\Core\TypedData\TranslatableInterface; */ class TranslateEntityAggregatedFieldProcessor extends ProcessorPluginBase implements BuildProcessorInterface, ContainerFactoryPluginInterface { use UnchangingCacheableDependencyTrait; /** * The language manager. * Loading Loading @@ -235,4 +232,21 @@ class TranslateEntityAggregatedFieldProcessor extends ProcessorPluginBase implem return FALSE; } /** * {@inheritdoc} */ public function getCacheContexts() { return Cache::mergeContexts(parent::getCacheContexts(), ['languages:language_interface']); } /** * {@inheritdoc} */ public function getCacheMaxAge() { // This will work unless the Search API Query uses "wrong" caching. Ideally // we would set a cache tag to invalidate the cache whenever a translatable // entity is added or changed. But there's no tag in drupal yet. return Cache::PERMANENT; } } src/Plugin/facets/processor/TranslateEntityProcessor.php +18 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; Loading @@ -29,8 +29,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class TranslateEntityProcessor extends ProcessorPluginBase implements BuildProcessorInterface, ContainerFactoryPluginInterface { use UnchangingCacheableDependencyTrait; /** * The language manager. * Loading Loading @@ -161,4 +159,21 @@ class TranslateEntityProcessor extends ProcessorPluginBase implements BuildProce return FALSE; } /** * {@inheritdoc} */ public function getCacheContexts() { return Cache::mergeContexts(parent::getCacheContexts(), ['languages:language_interface']); } /** * {@inheritdoc} */ public function getCacheMaxAge() { // This will work unless the Search API Query uses "wrong" caching. Ideally // we would set a cache tag to invalidate the cache whenever a translatable // entity is added or changed. But there's no tag in drupal yet. return Cache::PERMANENT; } } src/Plugin/facets/processor/UidToUserNameCallbackProcessor.php +15 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Cache\Cache; use Drupal\Core\TypedData\ComplexDataDefinitionInterface; use Drupal\Core\TypedData\DataReferenceDefinitionInterface; use Drupal\facets\FacetInterface; Loading @@ -24,8 +24,6 @@ use Drupal\user\Entity\User; */ class UidToUserNameCallbackProcessor extends ProcessorPluginBase implements BuildProcessorInterface { use UnchangingCacheableDependencyTrait; /** * {@inheritdoc} */ Loading Loading @@ -72,4 +70,18 @@ class UidToUserNameCallbackProcessor extends ProcessorPluginBase implements Buil return FALSE; } /** * {@inheritdoc} */ public function getCacheMaxAge() { return Cache::PERMANENT; } /** * {@inheritdoc} */ public function getCacheTags() { return Cache::mergeTags(parent::getCacheTags(), ['user_list']); } } Loading
src/Plugin/facets/hierarchy/DateItems.php +3 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\facets\Plugin\facets\hierarchy; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\facets\Hierarchy\HierarchyPluginBase; /** Loading @@ -15,6 +16,8 @@ use Drupal\facets\Hierarchy\HierarchyPluginBase; */ class DateItems extends HierarchyPluginBase { use UnchangingCacheableDependencyTrait; /** * Static cache for the parents. * Loading
src/Plugin/facets/processor/TermWeightWidgetOrderProcessor.php +2 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; Loading Loading @@ -133,7 +134,7 @@ class TermWeightWidgetOrderProcessor extends SortProcessorPluginBase implements * {@inheritdoc} */ public function getCacheTags() { return ['taxonomy_term:list']; return Cache::mergeTags(parent::getCacheTags(), ['taxonomy_term_list']); } }
src/Plugin/facets/processor/TranslateEntityAggregatedFieldProcessor.php +17 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Config\ConfigManagerInterface; Loading Loading @@ -32,8 +31,6 @@ use Drupal\Core\TypedData\TranslatableInterface; */ class TranslateEntityAggregatedFieldProcessor extends ProcessorPluginBase implements BuildProcessorInterface, ContainerFactoryPluginInterface { use UnchangingCacheableDependencyTrait; /** * The language manager. * Loading Loading @@ -235,4 +232,21 @@ class TranslateEntityAggregatedFieldProcessor extends ProcessorPluginBase implem return FALSE; } /** * {@inheritdoc} */ public function getCacheContexts() { return Cache::mergeContexts(parent::getCacheContexts(), ['languages:language_interface']); } /** * {@inheritdoc} */ public function getCacheMaxAge() { // This will work unless the Search API Query uses "wrong" caching. Ideally // we would set a cache tag to invalidate the cache whenever a translatable // entity is added or changed. But there's no tag in drupal yet. return Cache::PERMANENT; } }
src/Plugin/facets/processor/TranslateEntityProcessor.php +18 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; Loading @@ -29,8 +29,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class TranslateEntityProcessor extends ProcessorPluginBase implements BuildProcessorInterface, ContainerFactoryPluginInterface { use UnchangingCacheableDependencyTrait; /** * The language manager. * Loading Loading @@ -161,4 +159,21 @@ class TranslateEntityProcessor extends ProcessorPluginBase implements BuildProce return FALSE; } /** * {@inheritdoc} */ public function getCacheContexts() { return Cache::mergeContexts(parent::getCacheContexts(), ['languages:language_interface']); } /** * {@inheritdoc} */ public function getCacheMaxAge() { // This will work unless the Search API Query uses "wrong" caching. Ideally // we would set a cache tag to invalidate the cache whenever a translatable // entity is added or changed. But there's no tag in drupal yet. return Cache::PERMANENT; } }
src/Plugin/facets/processor/UidToUserNameCallbackProcessor.php +15 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\facets\Plugin\facets\processor; use Drupal\Core\Cache\UnchangingCacheableDependencyTrait; use Drupal\Core\Cache\Cache; use Drupal\Core\TypedData\ComplexDataDefinitionInterface; use Drupal\Core\TypedData\DataReferenceDefinitionInterface; use Drupal\facets\FacetInterface; Loading @@ -24,8 +24,6 @@ use Drupal\user\Entity\User; */ class UidToUserNameCallbackProcessor extends ProcessorPluginBase implements BuildProcessorInterface { use UnchangingCacheableDependencyTrait; /** * {@inheritdoc} */ Loading Loading @@ -72,4 +70,18 @@ class UidToUserNameCallbackProcessor extends ProcessorPluginBase implements Buil return FALSE; } /** * {@inheritdoc} */ public function getCacheMaxAge() { return Cache::PERMANENT; } /** * {@inheritdoc} */ public function getCacheTags() { return Cache::mergeTags(parent::getCacheTags(), ['user_list']); } }