#111392Resolve the site of a site root page without loading its rootline
Description
Problem
SiteFinder::getSiteByPageId() loads the full rootline of the given page, even if the page itself is the root page of a site. The nearest site in the rootline of a site root is always the page itself, so the lookup is unnecessary.
This is expensive on installations with many sites: PageSlugCandidateProvider::getPagesFromDatabaseForCandidates() calls getSiteByPageId() for every candidate page, and each site root has the slug “/”. With a few hundred sites, a rootline is loaded for each of them on every frontend request.
SiteFinder::getSiteByPage() (added in #100378) still loads the rootline of the parent page for site roots below another page, e.g. nested sites.
Proposal
- Return the site directly if the page is the root page of a valid site and neither a rootline nor a mount point parameter is given.
- Skip the parent rootline in getSiteByPage() for site root pages.
- Invalid sites, mount points and given rootlines keep their behaviour.
Note: a deleted page that is configured as site root is now resolved to its site, where RootlineUtility failed with a PageNotFoundException before.
Related to the large-site collection #93547 and #95690.
Reviews 1
Related issues 3
History 35
-
Alexander Schnitzler changed Related to #93547 <span data-processor="relativetime" data-value="2026-11-10T07:38:27+00:00" > 11/10/26, 07:38 </span>
-
Alexander Schnitzler changed Related to #95690 <span data-processor="relativetime" data-value="2026-11-10T07:38:28+00:00" > 11/10/26, 07:38 </span>
-
Alexander Schnitzler changed Related to #102076 <span data-processor="relativetime" data-value="2026-11-10T07:38:29+00:00" > 11/10/26, 07:38 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 97500 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-10T07:39:46+00:00" > 11/10/26, 07:39 </span> -
Gerrit Code Review pushed patch set 2 for main to change 97500 <span data-processor="relativetime" data-value="2026-11-10T08:40:06+00:00" > 11/10/26, 08:40 </span>