You are here

class WebformUncacheableResponse in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Routing/WebformUncacheableResponse.php \Drupal\webform\Routing\WebformUncacheableResponse

Provides an uncacheable response.

Hierarchy

Expanded class hierarchy of WebformUncacheableResponse

1 file declares its use of WebformUncacheableResponse
WebformEntityController.php in src/Controller/WebformEntityController.php

File

src/Routing/WebformUncacheableResponse.php, line 10

Namespace

Drupal\webform\Routing
View source
class WebformUncacheableResponse extends Response {

  /**
   * {@inheritdoc}
   */
  public function __construct($url, $status = 302, $headers = []) {
    parent::__construct($url, $status, $headers);
    $this
      ->setPrivate();
    $this
      ->setMaxAge(0);
    $this
      ->setSharedMaxAge(0);
    $this->headers
      ->addCacheControlDirective('must-revalidate', TRUE);
    $this->headers
      ->addCacheControlDirective('no-store', TRUE);
  }

}

Members