public function PageCache::handle in Drupal 9
Same name and namespace in other branches
- 8 core/modules/page_cache/src/StackMiddleware/PageCache.php \Drupal\page_cache\StackMiddleware\PageCache::handle()
- 10 core/modules/page_cache/src/StackMiddleware/PageCache.php \Drupal\page_cache\StackMiddleware\PageCache::handle()
File
- core/
modules/ page_cache/ src/ StackMiddleware/ PageCache.php, line 79
Class
- PageCache
- Executes the page caching before the main kernel takes over the request.
Namespace
Drupal\page_cache\StackMiddlewareCode
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
// Only allow page caching on master request.
if ($type === static::MASTER_REQUEST && $this->requestPolicy
->check($request) === RequestPolicyInterface::ALLOW) {
$response = $this
->lookup($request, $type, $catch);
}
else {
$response = $this
->pass($request, $type, $catch);
}
return $response;
}