-
Notifications
You must be signed in to change notification settings - Fork 13
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
Can we lazy load below the fold? #6669
base: main
Are you sure you want to change the base?
Conversation
Size Change: +1.51 kB (+0.07%) Total Size: 2.23 MB
ℹ️ View Unchanged
|
import { retryPaymentStatus } from './retryPaymentStatus'; | ||
import { setThankYouOrder, unsetThankYouOrder } from './thankYouComponent'; | ||
|
||
const PaymentSection = lazy(() => import('./paymentSection')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a comment here on why lazy loading used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, if we decided to go with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice to pull these componets out of the checkout regardless of lazy loading. Great job. Really good example of how to do it, had to check what <suspense>
was for, good use of that too. Like this. Cron/Smoke tests also passed.
Interesting that the reported results vary so much between runs on the identical build. Have you looked into alternative ways of measuring page speed performance such as Chrome DevTools' Lighthouse panel, Lighthouse CLI or WebPageTest to see if these offer more consistent results over multiple runs? If there's variability could we run several tests for both the baseline and the build with updates, then calculate the average and standard deviation to account for variability? |
Also interested to know if an external factor impacts page speed metrics, eg. I'm thinking the Sourcepoint CMP. Could we we disable the CMP when profiling the page to see whether it produces more consistent results? |
What are you doing in this PR?
Putting one of the lower down sections in the checkout (the payment method selector) as a lazy loading import, to try improve the performance of the page
Trello Card
How to test
Uploaded to CODE and put the checkout page through https://pagespeed.web.dev/analysis
Have we considered potential risks?
People seeing "Loading..." (or similar)
Screenshots
Before
After
Results
Improved overall performance - lower total blocking time and better speed index. First and largest contentful paints remained the same, which makes sense because most of the loading of the page is unchanged
I repeated the test again, and the results got worse. Running page speed insights just once may not be a good enough indicator - however in general they look somewhat better
EDIT:
I think we can't put any stock into individual page speed score results eg I got these results running it back to back