Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CacheableJsonResponse.php

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

Expanded class hierarchy of CacheableJsonResponse

See also

\Drupal\Core\Cache\Cache

\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\Cache
View source
class CacheableJsonResponse extends JsonResponse implements CacheableResponseInterface {
    use CacheableResponseTrait;

}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal