class CacheableRedirectResponse

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Cache/CacheableRedirectResponse.php \Drupal\Core\Cache\CacheableRedirectResponse
  2. 10 core/lib/Drupal/Core/Cache/CacheableRedirectResponse.php \Drupal\Core\Cache\CacheableRedirectResponse
  3. 11.x core/lib/Drupal/Core/Cache/CacheableRedirectResponse.php \Drupal\Core\Cache\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;

}

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