Improve: shrink the two raster icons and batch the demo layout reads - #32
Merged
Merged
Conversation
Preload /img/wallpaper.jpg so the mockup background is requested from the document head instead of after the stylesheet parses. Raise .license and .foot-links span to rgba(255,255,255,.5) and darken the version badge to #0072b5, bringing all three above the 4.5 contrast minimum.
Replace tdarr.png and speedtest-tracker.png with 64px WebP, matching the 11px they render at. The pair drops from 35.4 KB to 5.3 KB. Read .wcell and .np before writing --ws and --nps in fitDemoWidgets, and throttle the resize handler with requestAnimationFrame, so the interleaved reads no longer force a layout pass each. Serve /_astro/* and /fonts/* with a one year immutable cache instead of the four hour default. Exclude .webp from the check-dist text scans alongside the other binaries.
Deploying stackyard-docs with
|
| Latest commit: |
9c3b7eb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://75576e35.stackyard-docs.pages.dev |
| Branch Preview URL: | https://perf-icon-webp-and-batched-l.stackyard-docs.pages.dev |
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.
Summary
public/icons/tdarr.png(24.9 KB) andpublic/icons/speedtest-tracker.png(10.5 KB) with 64px WebP at 3.0 KB and 2.4 KB. Both render at 11 CSS px in the folder minis, so 64px covers DPR 3..wcelland.npreads before the--wsand--npswrites infitDemoWidgets, and throttle theresizeandchangehandlers throughrequestAnimationFrame. The previous read/write interleaving forced a synchronous layout on each write./_astro/*and/fonts/*topublic/_headerswithmax-age=31536000, immutable; they were falling through to the four hour default despite_astrofilenames being content hashed.webpto the two binary exclusions inscripts/check-dist.mjsso the hygiene and secret scans do not read WebP bytes as UTF-8.Testing
All green:
npm run buildandnpm run checkboth pass. Verified in Chrome againstastro preview: both icons load at 64x64 with transparency intact and no broken images, and at a 393px viewport--sc,--wsand--npsresolve to identical values before and after the reflow change.Checklist
npm run buildandnpm run checkboth pass.