Defines the HeadersCacheContext service, for "per header" caching.
Cache context ID: 'headers' (to vary by all headers). Calculated cache context ID: 'headers:%name', e.g. 'headers:X-Something' (to vary by the 'X-Something' header).
Hierarchy
- class \Drupal\Core\Cache\Context\RequestStackCacheContextBase
- class \Drupal\Core\Cache\Context\HeadersCacheContext implements CalculatedCacheContextInterface
File
- core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php, line 14
Namespace
Drupal\Core\Cache\Context
Members
Name | Modifiers | Type | Description |
---|---|---|---|
HeadersCacheContext::getCacheableMetadata | public | function | Gets the cacheability metadata for the context based on the parameter value. Overrides CalculatedCacheContextInterface::getCacheableMetadata |
HeadersCacheContext::getContext | public | function | Returns the string representation of the cache context. Overrides CalculatedCacheContextInterface::getContext |
HeadersCacheContext::getLabel | public static | function | Returns the label of the cache context. Overrides CalculatedCacheContextInterface::getLabel |
RequestStackCacheContextBase::$requestStack | protected | property | The request stack. |
RequestStackCacheContextBase::__construct | public | function | Constructs a new RequestStackCacheContextBase class. |
Please login to continue.