function DenyNodePreview::check

Same name in other branches
  1. 9 core/modules/node/src/PageCache/DenyNodePreview.php \Drupal\node\PageCache\DenyNodePreview::check()
  2. 8.9.x core/modules/node/src/PageCache/DenyNodePreview.php \Drupal\node\PageCache\DenyNodePreview::check()
  3. 10 core/modules/node/src/PageCache/DenyNodePreview.php \Drupal\node\PageCache\DenyNodePreview::check()

Overrides ResponsePolicyInterface::check

File

core/modules/node/src/PageCache/DenyNodePreview.php, line 38

Class

DenyNodePreview
Cache policy for node preview page.

Namespace

Drupal\node\PageCache

Code

public function check(Response $response, Request $request) {
    if ($this->routeMatch
        ->getRouteName() === 'entity.node.preview') {
        return static::DENY;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.