perf: defer and deprioritize Lingo Wave 2 cross-site index fetches#6209
Closed
mokimo wants to merge 1 commit into
Closed
perf: defer and deprioritize Lingo Wave 2 cross-site index fetches#6209mokimo wants to merge 1 commit into
mokimo wants to merge 1 commit into
Conversation
On Lingo-active pages (e.g. /fr/creativecloud), lingo-site-mapping.json
resolves quickly (~70ms) and immediately triggers 6 cross-site query index
fetches (Wave 2) while Wave 1's 45KB + 26KB files are still downloading.
On 4G this bandwidth race delays Wave 1 completion by ~220ms, pushing back
the LCP image fetch start.
Three changes:
- Add fetchOptions param to processQueryIndexMap so callers can control
fetch priority independently.
- Fetch lingo-site-mapping.json with { priority: 'low' } — it has no LCP
dependency and should not compete with hero CSS/JS.
- Await Wave 1 (primary + base pathsRequests) inside the lingoSiteMapping
IIFE before firing the Wave 2 forEach, so cross-site indexes only start
after the bandwidth-heavy Wave 1 files have landed. Wave 2 calls also
pass { priority: 'low' }.
Wave 1 is unchanged — fires immediately at default priority for LCP section
link localization.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
Commits
|
Contributor
Author
|
Closed in favor of #6210 |
This file contains hidden or 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
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.
Description
On Lingo-active pages (e.g. `/fr/creativecloud`), `lingo-site-mapping.json` (0.9 KB) resolves in ~70 ms and immediately triggers 6 cross-site query-index fetches (Wave 2) while Wave 1's 45 KB + 26 KB primary/base indexes are still mid-download. On a 4G connection this bandwidth race delays Wave 1 completion by ~220 ms, pushing back the LCP image fetch start by the same amount.
Three changes in
utils.js:1.
fetchOptionsparam onprocessQueryIndexMapAdds an optional
fetchOptions = {}argument passed straight tofetch(), so call-sites can independently control priority.2.
priority: 'low'on lingo-site-mapping fetchThe site-mapping file has no LCP dependency — it only triggers cross-site index discovery. Deprioritising it frees bandwidth for LCP-critical hero CSS/JS during the most sensitive render window.
3. Await Wave 1 before firing Wave 2
Inside the
lingoSiteMappingIIFE, added:before the Wave 2
forEach. Wave 2 now starts only after the 45 KB + 26 KB Wave 1 files have landed, eliminating the bandwidth race entirely on slow connections. Wave 2 calls also pass{ priority: 'low' }.Wave 1 is unchanged — fires immediately at default priority, required for LCP-section link localization.
Before (4G): Wave 2 fires at ~t+70 ms (site-mapping resolves), competing with Wave 1 still downloading its 71 KB.
After (4G): Wave 2 fires at ~t+295 ms (after Wave 1 lands), no overlap.
Resolves: MWPW-TBD
Test URLs (da-cc fr/creativecloud):
🤖 Generated with Claude Code