Repository navigation
perf(home): cut the home page's first-visit document and font cost - #54
Merged
maxitect merged 3 commits intoNov 13, 2026
Merged
Conversation
✅ Deploy Preview for clarksbowlingclub ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
maxitect
marked this pull request as ready for review
November 13, 2026 00:56
maxitect
deleted the
feat/52-home-page-lcp-get-production-lighthouse-mobile-to
branch
November 13, 2026 00:58
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.
What
Production Lighthouse mobile sat at 85 to 90 with LCP 3.2 to 3.7 s while a local production build scored 93 or more. The gap came from a header Payload adds to every page, not from the page. This PR removes it, plus one unused font preload.
Changes
Critical-CH: Sec-CH-Prefers-Color-Scheme(added to every route bywithPayload) now applies to/adminonly. Chrome answersCritical-CHon a first visit by discarding the document response and requesting it again, so every new visitor to a public page paid the time to first byte twice. On production that first discarded request took 427 ms in Lighthouse (""row, 71 B, in the network log) against 5 ms locally, which is why only production was slow. The admin still gets the header, so its dark-mode detection is unchanged.src/lib/calendar/fonts.ts), yet it was preloaded on every page.○ /in the build output,x-nextjs-prerender: 1andcache-status: "Next.js"; hiton production. No change needed.Acceptance criteria
/scores 90+, median of three, LCP under 2.5 sCloses
Closes #52
Notes
clarksbowlingclub, Cloud compute, Functions, Region tab, Configure, pick EU (Frankfurt) (fra; the ticket'seu-central-1is the AWS name), Save, then redeploy. It would not move the home page score:/is served from the CDN cache and runs no function, so this is for the dynamic routes (/api/*,/calendrier, the admin) that read Neon in Frankfurt.npx -y lighthouse@12 https://clarksbowlingclub.com --form-factor=mobile --chrome-flags="--headless=new"three times and confirm 90+ and LCP under 2.5 s. Single runs vary by up to 10 points from one machine (production alone gave 79 to 94 today).<span>, painted from the server HTML. Lighthouse's simulated LCP counts the fonts and scripts requested before that paint, so fewer early bytes and one fewer document round trip lower it.app.netlify.com, which the site's CSP blocks and logs as one console error. It is not present on production and not caused by this PR.src/lib/security/headers.ts, the carousel, About page and Payload config (Carousel photos in Payload, with images compressed on upload #43).Review
Verdict: ALL CLEAR
Rounds: 2
Critical-CHAlso checked: only Payload's admin Root layout reads
Sec-CH-Prefers-Color-Scheme(getRequestTheme), and the admin still gets the Critical-CH retry, so its first-load theme is unchanged (samedata-themeas production in dark and light)./api/*and/calendriernever read it. #34's CSP,X-Frame-Options,Referrer-PolicyandPermissions-Policyare still sent on/,/about,/tour,/api/*,/admin/*,/calendrierand a 404, on the preview and locally. Goudy: nofont-goudyclass or variable anywhere on the public site./,/about,/tour,/musicand/lyricsat 390 and 1280 px use the same font families and page heights as production, with pixel-identical screenshots outside the home video frame and image compression noise on/about(.git/ticket/52/artefacts/review/). Lighthouse at 00:53 UTC, interleaved: production 76 / 88 / 96 (median 88, LCP 3.43 s), preview 98 / 95 / 98 (median 98, LCP 1.99 s). First visit document requests: production 2 on/and/about, preview 1 (2 on/admin).Re-verified: AC1 (deploy and local build:
Critical-CHonly on/admin*, one document request on/, throws when Payload's rule loses it) PASS, AC3 (browser, local build: autoplay, poster,hls/master.m3u8first, 390 and 1280, EN and FR) PASS, AC4 (browser, local build: no console errors) PASS · check.sh PASSEvidence
AC1
Lighthouse 12, mobile, headless Chrome, three runs each, 13 November 2026.
AC2
Screenshots of production and the preview at 1280 and 390 px with
?isFrench=falseand?isFrench=true(the preview ones carry Netlify's grey preview bar at the bottom):.git/ticket/52/artefacts/{prod,preview}-{1280,390}-fr{false,true}.png. The 390 px French pair was compared by eye: header, toggle, video controls, footer text and position are identical.AC3
AC4