Skip to content

Warm up the projects page from links to it - #119

Open
adrianmg wants to merge 1 commit into
masterfrom
adrianmg-preload-projects
Open

adrianmg wants to merge 1 commit into
masterfrom
adrianmg-preload-projects

Conversation

@adrianmg

@adrianmg adrianmg commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Hovering, focusing or touching a link to /projects/ now gets its cover images ready before the click.

  • Chromium: /projects/ moves from prefetch to prerender (moderate eagerness), so the page and its covers are rendered ahead.
  • Other browsers: a small inline script preloads the three covers via imagesrcset/imagesizes, so the browser picks the same size the page will use. Skipped when Data Saver is on.
  • The cover srcset and sizes now live in src/lib/projects.ts, shared by the page and the warmup.

Verified in Chrome and WebKit at 1280@2x and 390@3x: hover fetches exactly the variant the page then displays (640w on desktop, 1280w on phones), nothing before hover, no console errors. Check, build and tests pass.

Chromium prerenders /projects/ on hover; other browsers preload the three
covers at the size the page will pick, skipped under Data Saver.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant