diff -u b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php --- b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php @@ -1469,6 +1469,27 @@ } /** + * {@inheritdoc} + */ + public function isCacheable() { + return TRUE; + } + + /** + * {@inheritdoc} + */ + public function getCacheContexts() { + $cache_contexts = []; + // An exposed filter allows the user to change a view's filters. They accept + // input from GET parameters, which are part of the URL. Hence a view with + // an exposed filter is cacheable per URL. + if ($this->isExposed()) { + $cache_contexts[] = 'url'; + } + return $cache_contexts; + } + + /** * Gets the current active user. * * @return \Drupal\Core\Session\AccountInterface @@ -1484,4 +1504,0 @@ - -/** - * @} - */