class CacheableJsonResponse
A JsonResponse that contains and can expose cacheability metadata.
Supports Drupal's caching concepts: cache tags for invalidation and cache contexts for variations.
Hierarchy
- class \Symfony\Component\HttpFoundation\Response
- class \Symfony\Component\HttpFoundation\JsonResponse extends \Symfony\Component\HttpFoundation\Response
- class \Drupal\Core\Cache\CacheableJsonResponse extends \Symfony\Component\HttpFoundation\JsonResponse implements \Drupal\Core\Cache\CacheableResponseInterface uses \Drupal\Core\Cache\CacheableResponseTrait
- class \Symfony\Component\HttpFoundation\JsonResponse extends \Symfony\Component\HttpFoundation\Response
Expanded class hierarchy of CacheableJsonResponse
See also
\Drupal\Core\Cache\CacheableMetadata
\Drupal\Core\Cache\CacheableResponseTrait
2 files declare their use of CacheableJsonResponse
- ExceptionJsonSubscriber.php in core/
lib/ Drupal/ Core/ EventSubscriber/ ExceptionJsonSubscriber.php - LinksetController.php in core/
modules/ system/ src/ Controller/ LinksetController.php
File
-
core/
lib/ Drupal/ Core/ Cache/ CacheableJsonResponse.php, line 17
Namespace
Drupal\Core\CacheView source
class CacheableJsonResponse extends JsonResponse implements CacheableResponseInterface {
use CacheableResponseTrait;
}