hlxsites / aem-boilerplate-commerce

Use this repository template for new AEM+Commerce projects.
https://main--aem-boilerplate-commerce--hlxsites.aem.live
Apache License 2.0
27 stars 21 forks source link

fix: set body to display:none initially #160

Closed buuhuu closed 4 weeks ago

buuhuu commented 4 weeks ago

Instead of using display:none on the body during the early eager phase, the commerce boilerplate uses visibility: hidden. Content that is hidden that way will still be layouted by the browser and this causes the browser to change the loading priority of images from low to high which loads images immediately even below the fold before LCP.

develop (breakpoint at scripts.js line 373 before any decoration happens) Screenshot 2024-10-31 at 15 28 34

visibility-fix (same breakpoint)

Screenshot 2024-10-31 at 15 44 02

Test URLs:

aem-code-sync[bot] commented 4 weeks ago

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.

Commits * [cf2c687](https://github.com/hlxsites/aem-boilerplate-commerce/commit/cf2c68769cd08c2ca47a3ae3ca085b219ad0bb96) :arrows_counterclockwise: (latest) * [dd05fa8](https://github.com/hlxsites/aem-boilerplate-commerce/commit/dd05fa8659743f59e4722a2dfa62b9f9e10fe3c5) :white_check_mark:
aem-code-sync[bot] commented 4 weeks ago
Page Scores Audits Google
:iphone: / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
:desktop_computer: / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI