Skip to content

perf: add 5s timeout + dedup to geo2 fetch, remove redundant fallback…#6207

Closed
mokimo wants to merge 1 commit into
stagefrom
feature/perf-geo-timeout
Closed

perf: add 5s timeout + dedup to geo2 fetch, remove redundant fallback…#6207
mokimo wants to merge 1 commit into
stagefrom
feature/perf-geo-timeout

Conversation

@mokimo

@mokimo mokimo commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

… call

geo2.adobe.com/json/ was fetched with no timeout (browser TCP timeout ~30s) and no deduplication — concurrent callers each started an independent fetch. resolveDetectedMarketCountry() compounded this by making a second serial geo2 attempt on failure, meaning a blocked geo2 could cost 60s total.

Changes:

  • geo.js: wrap fetch in AbortController with 5s timeout; cache the in-flight promise so concurrent calls share one fetch instead of each issuing a duplicate request
  • utils.js: remove the redundant getAkamaiCode() fallback block from resolveDetectedMarketCountry() — getCountry() already tried geo2 and returned null, an immediate retry will have the same result

lana.js loading late is a symptom, not a cause: it lazy-loads on the first window.lana.log() call, which fires when geo2 times out.

  • Add your
  • Specific
  • Features or fixes

Resolves: MWPW-NUMBER

Test URLs:

… call

geo2.adobe.com/json/ was fetched with no timeout (browser TCP timeout ~30s)
and no deduplication — concurrent callers each started an independent fetch.
resolveDetectedMarketCountry() compounded this by making a second serial
geo2 attempt on failure, meaning a blocked geo2 could cost 60s total.

Changes:
- geo.js: wrap fetch in AbortController with 5s timeout; cache the
  in-flight promise so concurrent calls share one fetch instead of
  each issuing a duplicate request
- utils.js: remove the redundant getAkamaiCode() fallback block from
  resolveDetectedMarketCountry() — getCountry() already tried geo2
  and returned null, an immediate retry will have the same result

lana.js loading late is a symptom, not a cause: it lazy-loads on the
first window.lana.log() call, which fires when geo2 times out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@mokimo

mokimo commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Closed in favor of #6210

@mokimo mokimo closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant