You are here

DenyBigPipeSessionlessResponses.php in Sessionless BigPipe 2.x

Same filename and directory in other branches
  1. 8 src/PageCache/ResponsePolicy/DenyBigPipeSessionlessResponses.php

File

src/PageCache/ResponsePolicy/DenyBigPipeSessionlessResponses.php
View source
<?php

namespace Drupal\big_pipe_sessionless\PageCache\ResponsePolicy;

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

/**
 * A policy denying caching of a BigPipe sessionless responses.
 */
class DenyBigPipeSessionlessResponses implements ResponsePolicyInterface {

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

}

Classes

Namesort descending Description
DenyBigPipeSessionlessResponses A policy denying caching of a BigPipe sessionless responses.