Repository navigation
perf(home): preload exactly the carousel image the browser renders - #643
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
launchpad | 4c7418a | Commit Preview URL Branch Preview URL |
Nov 22 2026, 10:58 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The home page triggered two preloads for the first carousel image. One was hand-written with
fetchpriority="high"; the other came from the image component, had no priority and used slightly different breakpoints (767/1023 vs 768/1024). The two could point at different candidates of the same picture, so the browser could fetch the hero image twice while the page was loading.Approach
The carousel now leaves preloading to the image component and asks it for high priority on the first slide only; the hand-written preload is gone. All six slide types take their
sizesfrom one shared constant, so the preload and the rendered<source>cannot drift apart. The project logo is no longer preloaded.Proposal:
openspec/changes/perf-home-lcp-image(#631).Result
Production build with the Cloudflare image provider, Lighthouse 12.8.2 mobile, median of 5:
/enfetchpriority=high,imagesizes= first<source sizes>)/en/deThe LCP change is within run-to-run noise; the gain is the removed duplicate fetch.
Tests
A file-reading spec holds the shared
sizesconstant in every slide; a component spec asserts that only the first slide asks for a high-priority preload and the project logo for none. The emitted<link>itself is server-only and was checked in the built HTML. Tests, quality gate (no rise) and production build pass.