Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SiteCacheContext.php

function SiteCacheContext::getContext

Overrides CacheContextInterface::getContext

File

core/lib/Drupal/Core/Cache/Context/SiteCacheContext.php, line 32

Class

SiteCacheContext
Defines the SiteCacheContext service, for "per site" caching.

Namespace

Drupal\Core\Cache\Context

Code

public function getContext() {
    $request = $this->requestStack
        ->getCurrentRequest();
    return $request->getSchemeAndHttpHost() . $request->getBaseUrl();
}
RSS feed
Powered by Drupal