VariationCache::$redirectChainCache

Same name and namespace in other branches
  1. main core/lib/Drupal/Core/Cache/VariationCache.php \Drupal\Core\Cache\VariationCache::redirectChainCache

Stores redirect chain lookups until the next set, invalidate or delete.

Array keys are the cache IDs constructed from the cache keys and initial cacheability and values are arrays where each step of a redirect chain is recorded.

These arrays are indexed by the cache IDs being followed during the chain and the CacheRedirect objects that construct the chain. At the end there should always be a value of FALSE for a cache miss, or a CacheRedirect for a cache hit because we cannot store the cache hit itself into a property that does not support invalidation based on cache metadata. By storing the last CacheRedirect that led to the hit, we can at least avoid having to retrieve the entire chain again to get to the actual cached data.

Type: array

File

core/lib/Drupal/Core/Cache/VariationCache.php, line 32

Class

VariationCache
Wraps a regular cache backend to make it support cache contexts.

Namespace

Drupal\Core\Cache

Code

protected array $redirectChainCache = [];

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.