core/modules/node/src/Controller/NodeViewController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/modules/node/src/Controller/NodeViewController.php b/core/modules/node/src/Controller/NodeViewController.php index b8aa1e5..22cd1ed 100644 --- a/core/modules/node/src/Controller/NodeViewController.php +++ b/core/modules/node/src/Controller/NodeViewController.php @@ -55,7 +55,7 @@ public function view(EntityInterface $node, $view_mode = 'full', $langcode = NUL $build = parent::view($node, $view_mode, $langcode); foreach ($node->uriRelationships() as $rel) { - $url = $node->toUrl($rel); + $url = $node->toUrl($rel)->setAbsolute(TRUE); // Add link relationships if the user is authenticated or if the anonymous // user has access. Access checking must be done for anonymous users to // avoid traffic to inaccessible pages from web crawlers. For @@ -89,6 +89,9 @@ public function view(EntityInterface $node, $view_mode = 'full', $langcode = NUL } } + // Since this generates absolute URLs, it can only be cached "per site". + $build['#cache']['contexts'][] = 'url.site'; + // Given this varies by $this->currentUser->isAuthenticated(), add a cache // context based on the anonymous role. $build['#cache']['contexts'][] = 'user.roles:anonymous';