generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MWPW-162839: Move title-append to loadArea #3341
Open
hparra
wants to merge
8
commits into
adobecom:stage
Choose a base branch
from
hparra:MWPW-162839-1
base: stage
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #3341 +/- ##
==========================================
- Coverage 96.48% 96.48% -0.01%
==========================================
Files 254 253 -1
Lines 59031 59029 -2
==========================================
- Hits 56955 56953 -2
Misses 2076 2076 ☔ View full report in Codecov by Sentry. |
mokimo
approved these changes
Dec 11, 2024
chrischrischris
approved these changes
Dec 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We increase likelihood that googlebot sees a title modified by
title-append
by reducing time to modification. We do this by moving logic fortitle-append
into utils.js and executing it as part ofloadArea
. Resolves: MWPW-162839.Problem
The title-append feature is an easy way for authors to append a common string to multiple page
title
tags using bulk metadata, saving considerable authoring hours: https://milo.adobe.com/docs/authoring/features/title-appendWhile working correctly for users, the primary consumer of this feature are web crawlers, e.g. googlebot. We are seeing inconsistency in title seen by google crawls (UrlInspection) and in SERPs. Team has demonstrated that for all pages that use this feature only a minor fraction of them are indexed as such, e.g. "20% for UK/AU and 10% for FR/DE". (Source: BrightEdge)
While problem may be more complicated, we've noticed pages that load quickly are less likely to show the appended title in UrlInspection or SERPs. Hypothesis is that googlebot moves on before seeing updated page title because it is currently executing late in milo load process via
documentPostSectionLoading
.More pages across clouds are using this feature, and it should work as expected.
Solution
Page title is similar to canonical and .html extension in that is significantly affects SERPs, so it makes sense to group similar code together.
We move function into libs/utils/util.js and call it in
loadArea
right afterappendHtmlToCanonicalUrl
:milo/libs/utils/utils.js
Line 1298 in 6f4d98c
Testing
Unit
Existing utils.js test improved.
E2E
If you open test urls in a new window with full-sized tabs, you can visually see the appended title in the tabs. Notice the significant difference in speed between before and after versions. Before takes several seconds while After is instant.
Test URLs:
Performance
A net 10 lines or 0.46 KB (uncompressed) were added to utils.js. See MWPW-162839 for evidence that even a recent addition of 2.2 KB did not affect P95 for file download speed.