-
Notifications
You must be signed in to change notification settings - Fork 152
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
chore(perf): include a high-priority image in Link response headers, if available #14974
Conversation
#1314 Bundle Size — 8.95MiB (-0.03%).14b11e7(current) vs ce82e30 main#1313(baseline) Warning Bundle contains 14 duplicate packages – View duplicate packages Bundle metrics
|
Current #1314 |
Baseline #1313 |
|
---|---|---|
Initial JS | 3.65MiB (~-0.01% ) |
3.65MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 41.34% |
39.38% |
Chunks | 103 |
103 |
Assets | 106 |
106 |
Modules | 5834 (-0.03% ) |
5836 |
Duplicate Modules | 530 |
530 |
Duplicate Code | 4.03% |
4.03% |
Packages | 266 |
266 |
Duplicate Packages | 13 |
13 |
Bundle size by type 1 change
1 improvement
Current #1314 |
Baseline #1313 |
|
---|---|---|
JS | 8.81MiB (-0.03% ) |
8.81MiB |
Other | 143.36KiB |
143.36KiB |
Bundle analysis report Branch joeyAghion/lcpHint Project dashboard
Generated by RelativeCI Documentation Report issue
This PR currently results in
I will try to verify if this actually improves LCP locally or in a review app. Questions:
|
Discussed this on slack. But yah, makes sense! We should just prioritize the 2x images getting into the header tags and then 🚢 |
e1e3a4b
to
a1dd5dd
Compare
a1dd5dd
to
41b2d27
Compare
41b2d27
to
14b11e7
Compare
Latest commit avoids any sort of HTML-parsing and just extracts the images for preloading from the already available head tags. That way, any components can render With this code, artwork pages respond with 2 images for preloading (the Next question, which can be considered in this PR or a separate one: those pages currently populate |
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.
Love this elegant solution 👍
Lets hint the 2x image and monitor for now, but otherwise merge when ready!
a6d4544
to
14b11e7
Compare
(Work-in-progress for feedback only.)
This is heavily based on #14827, and a few naïve assumptions. It attempts to add a
Link:
header on responses indicating that browsers should preload an image from the rendered HTML.fetchpriority="high"
.src
attribute of thatimg
element, so doesn't benefit fromsrcSet
and may even cause a 2x browser to preload a 1x image unnecessarily.