class CacheableRedirectResponse

A RedirectResponse that contains and can expose cacheability metadata.

Supports Drupal's caching concepts: cache tags for invalidation and cache contexts for variations.

Hierarchy

Expanded class hierarchy of CacheableRedirectResponse

See also

\Drupal\Core\Cache\Cache

\Drupal\Core\Cache\CacheableMetadata

\Drupal\Core\Cache\CacheableResponseTrait

2 files declare their use of CacheableRedirectResponse
RedirectLeadingSlashesSubscriber.php in core/lib/Drupal/Core/EventSubscriber/RedirectLeadingSlashesSubscriber.php
TrustedRedirectResponseTest.php in core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php

File

core/lib/Drupal/Core/Cache/CacheableRedirectResponse.php, line 17

Namespace

Drupal\Core\Cache
View source
class CacheableRedirectResponse extends RedirectResponse implements CacheableResponseInterface {
  use CacheableResponseTrait;

}

Members

Title Sort descending Modifiers Object type Summary
CacheableResponseTrait::$cacheabilityMetadata protected property The cacheability metadata.
CacheableResponseTrait::addCacheableDependency public function
CacheableResponseTrait::getCacheableMetadata public function

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