You are here

public function WebformUncacheableResponse::__construct in Webform 8.5

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

File

src/Routing/WebformUncacheableResponse.php, line 15

Class

WebformUncacheableResponse
Provides an uncacheable response.

Namespace

Drupal\webform\Routing

Code

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);
}