You are here

protected function PageCache::getCacheId in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/page_cache/src/StackMiddleware/PageCache.php \Drupal\page_cache\StackMiddleware\PageCache::getCacheId()

Gets the page cache ID for this request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: A request object.

Return value

string The cache ID for this request.

2 calls to PageCache::getCacheId()
PageCache::get in core/modules/page_cache/src/StackMiddleware/PageCache.php
Returns a response object from the page cache.
PageCache::set in core/modules/page_cache/src/StackMiddleware/PageCache.php
Stores a response object in the page cache.

File

core/modules/page_cache/src/StackMiddleware/PageCache.php, line 327
Contains \Drupal\page_cache\StackMiddleware\PageCache.

Class

PageCache
Executes the page caching before the main kernel takes over the request.

Namespace

Drupal\page_cache\StackMiddleware

Code

protected function getCacheId(Request $request) {
  $cid_parts = array(
    $request
      ->getUri(),
    $request
      ->getRequestFormat(),
  );
  return implode(':', $cid_parts);
}