protected function DomainRouteProvider::getRouteCollectionCacheId in Domain Access 8
Returns the cache ID for the route collection cache.
We are overriding the cache id by inserting the host to the cid.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request object.
Return value
string The cache ID.
Overrides RouteProvider::getRouteCollectionCacheId
See also
\Drupal\Core\Routing\RouteProvider::getRouteCollectionCacheId()
File
- domain/
src/ Routing/ DomainRouteProvider.php, line 57
Class
- DomainRouteProvider
- Custom router.route_provider service to make it domain context sensitive.
Namespace
Drupal\domain\RoutingCode
protected function getRouteCollectionCacheId(Request $request) {
// Include the current language code in the cache identifier as
// the language information can be elsewhere than in the path, for example
// based on the domain.
$language_part = $this
->getCurrentLanguageCacheIdPart();
return 'route:' . $request
->getHost() . ':' . $language_part . ':' . $request
->getPathInfo() . ':' . $request
->getQueryString();
}