diff --git a/core/modules/views/config/schema/views.data_types.schema.yml b/core/modules/views/config/schema/views.data_types.schema.yml index a1540b6..e69060d 100644 --- a/core/modules/views/config/schema/views.data_types.schema.yml +++ b/core/modules/views/config/schema/views.data_types.schema.yml @@ -268,9 +268,9 @@ views_display: field_langcode_add_to_query: type: string label: 'Add the field language to the query' - cacheability: + cache_metadata: type: mapping - label: 'Cacheability' + label: 'Cache metadata' mapping: cacheable: type: boolean diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php index 7f2b053..c504362 100644 --- a/core/modules/views/src/Entity/View.php +++ b/core/modules/views/src/Entity/View.php @@ -303,15 +303,15 @@ public function preSave(EntityStorageInterface $storage) { // @todo Check whether isSyncing is needed. if (!$this->isSyncing()) { - $this->fillInCacheability(); + $this->addCacheMetadata(); } } /** - * Fills in the cacheability of this view. + * Fills in the cache metadata of this view. * - * Cacheability is set per view and per display, and ends up being stored in - * the view's config entity. This allows Views to determine very efficiently: + * Cache metadata is set per view and per display, and ends up being stored in + * the view's configuration. This allows Views to determine very efficiently: * - whether a view is cacheable at all * - what the cache key for a given view should be * @@ -319,7 +319,7 @@ public function preSave(EntityStorageInterface $storage) { * Views plugins and handlers to determine their effect on the cacheability of * a view at save time rather than at runtime. */ - protected function fillInCacheability() { + protected function addCacheMetadata() { $executable = $this->getExecutable(); $current_display = $executable->current_display; @@ -327,11 +327,11 @@ protected function fillInCacheability() { foreach ($displays as $display_id => $display) { $executable->setDisplay($display_id); - list($display['cacheability']['cacheable'], $display['cacheability']['contexts']) = $executable->getDisplay()->calculateCacheability(); + list($display['cache_metadata']['cacheable'], $display['cache_metadata']['contexts']) = $executable->getDisplay()->calculateCacheMetadata(); // Always include at least the language context as there will be most // probable translatable strings in the view output. - $display['cacheability']['contexts'][] = 'cache.context.language'; - $display['cacheability']['contexts'] = array_unique($display['cacheability']['contexts']); + $display['cache_metadata']['contexts'][] = 'cache.context.language'; + $display['cache_metadata']['contexts'] = array_unique($display['cache_metadata']['contexts']); } // Restore the previous active display. $executable->setDisplay($current_display); diff --git a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php index 07d3e14..638d6ca 100644 --- a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php +++ b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php @@ -368,7 +368,7 @@ protected function getCacheTags() { } /** - * Alters the cacheability of a display upon saving a view. + * Alters the cache metadata of a display upon saving a view. * * @param bool $is_cacheable * Whether the display is cacheable. diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 396715c..4f9e432 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2288,14 +2288,14 @@ public function preExecute() { } /** - * Calculates the display's cacheability, by inspecting each handler/plugin. + * Calculates the display's cache metadata by inspecting each handler/plugin. * * @return array * Returns an array: * - first value: (boolean) Whether the display is cacheable. * - second value: (string[]) The cache contexts the display varies by. */ - public function calculateCacheability () { + public function calculateCacheMetadata () { $is_cacheable = TRUE; $cache_contexts = [];