Repository navigation
perf(landing): self-host fonts, one analytics and smaller thumbs - #234
Merged
Merged
Conversation
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 landing weighed 220 KB across 14 requests on a 360 px viewport, with 102 KB of that being web fonts pulled from Google Fonts (Inter with optical sizing plus italic, JetBrains Mono), 10 KB of Google CSS, and two analytics scripts loading on every visit.
Changes
landing/assets/fonts/: Inter latin (48 KB) and JetBrains Mono latin (31 KB) as WOFF2, with their OFL licences. The variable instances drop the optical size axis and italics, none of which the page uses.landing/styles.css:@font-facefor both families withfont-display: swapand latinunicode-range. Below 861 px,codeuses the system monospace stack so phones never download the mono.landing/index.html: Google Fonts link and bothpreconnecthints removed, apreloadfor the Inter file added, and the GoatCounter script removed. Umami stays. Cache-bust to?v=8.landing/app.js: slider thumbnails declare 96x64 and decode asynchronously.landing/styles.css: header link gap and padding trimmed by a few pixels, which keeps the desktop nav at 63 px in one row instead of wrapping to 84 px once the narrower self-hosted Inter is used.Verification
Measured at 360x740 dpr2 against production:
Playwright suites against production: 219/219 checks (54 page weight, 55 header and hero, 62 install section, 48 slider). No console errors, no horizontal overflow at 360, 390, 414, 1280 or 1440 px. Desktop nav is 63 px in one row at 1000, 1100, 1200, 1280 and 1440 px.
The nginx virtual host for this site had
font-src https://fonts.gstatic.com, which blocked the self-hosted files. It now usesfont-src 'self'and no longer allowsfonts.googleapis.cominstyle-src. Changed with a backup and a validated reload.Already deployed to https://nextsync.cloudless.club/ and verified there.
Closes #233