Repository navigation
perf(landing): responsive screenshot variants and 30-day cache headers - #238
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
Lighthouse mobile on production scored 100 but left two audits at zero:
uses-responsive-images0 andimage-delivery-insight0: every visitor downloaded a 1800x1200 screenshot (~15.7 KB) for a box of 312 to 940 px, and the thumbnails did the same for a 72 px square.cache-insight0:jsandcsswere cached for one hour,og.pngfor seven days, and images had no cache header at all.Changes
landing/app.js: ashot()factory builds each slide withsrc(960), asrcsetof 320/640/960/1080/1800 and athumb(320). The lightbox always opens the 1800 original instead of copying whatever the slider had loaded.landing/index.html:srcsetandsizeson the slider image, cache-bust toapp.js?v=11.landing/assets/shots/: 16 WebP variants (4 screenshots x 320/640/960/1080), generated with ImageMagick at quality 82..bak-cache-20261029,nginx -tand hot reload):jsandcssfrom 1h to 30 days,og.pngfrom 7d to 30 days, and a new rule giving images 30 days.Verification
verify-nxs-srcset.js: 30/30 against production. The chosen variant matches the box at 360 dpr2, 390 dpr3 and 1280 dpr1, thumbnails load the 320 file, the lightbox opens the 1800 original, no overflow, no console errors.uses-responsive-images,image-delivery-insightandcache-insightnow pass.uses-long-cache-ttlstays at 0.5 on purpose: Lighthouse rewards a one-year TTL, and screenshots change with each release, so 30 days is the deliberate choice.Already deployed to https://nextsync.cloudless.club/ and verified there.
Closes #237