Skip to content

testing bg#772

Merged
helms-charity merged 1 commit into
mainfrom
769-svgtexture
Mar 10, 2026
Merged

testing bg#772
helms-charity merged 1 commit into
mainfrom
769-svgtexture

Conversation

@helms-charity

@helms-charity helms-charity commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

With this change, I am seeing much better mobile scores.

Before:
image

After:
image

Summary of changes for LCP and resource load delay:

  1. Preload at the start of <head>
    The preload link is now inserted with document.head.insertBefore(preloadLink, document.head.firstChild) instead of appendChild. The browser sees the LCP image preload earlier, which can reduce load delay.

  2. Use a real <img> for the LCP image
    The background is no longer applied only via background-image on the section. The first picture is moved into a dedicated background layer and kept in the DOM as a real <img> with:

fetchpriority="high" – asks the browser to prioritize this image
loading="eager" – avoids lazy-loading so it starts loading immediately
PageSpeed and other tools treat visible <img> elements as LCP candidates and prioritize them; CSS background images are often discovered and prioritized later. Keeping the hero image as an <img> in a full-bleed layer improves the chance it’s treated as LCP and loads earlier.

  1. New background layer and CSS
    A div with class hero-heritage-cc-bg-layer is inserted as the first child of the section.
    The first picture (and its wrapper) is moved into this layer instead of being removed.
    CSS makes the layer full-viewport with position: fixed; inset: 0; z-index: -1 and the image object-fit: cover so the look matches the previous fixed, cover background.

Test URLs:

image

@aem-code-sync

aem-code-sync Bot commented Mar 10, 2026

Copy link
Copy Markdown

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

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync

aem-code-sync Bot commented Mar 10, 2026

Copy link
Copy Markdown

@helms-charity
helms-charity requested a review from roperev March 10, 2026 16:26

@roperev roperev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be great

@helms-charity
helms-charity merged commit 3f0934e into main Mar 10, 2026
1 of 2 checks passed
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.

2 participants