You are here

NoServerError.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/lib/Drupal/Core/PageCache/ResponsePolicy/NoServerError.php

File

core/lib/Drupal/Core/PageCache/ResponsePolicy/NoServerError.php
View source
<?php

/**
 * @file
 * Contains \Drupal\Core\PageCache\ResponsePolicy\NoServerError.
 */
namespace Drupal\Core\PageCache\ResponsePolicy;

use Drupal\Core\PageCache\ResponsePolicyInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
 * A policy denying caching of a server error (HTTP 5xx) responses.
 */
class NoServerError implements ResponsePolicyInterface {

  /**
   * {@inheritdoc}
   */
  public function check(Response $response, Request $request) {
    if ($response
      ->isServerError()) {
      return static::DENY;
    }
  }

}

Classes

Namesort descending Description
NoServerError A policy denying caching of a server error (HTTP 5xx) responses.