# Performance Test Instructions — frontend-shell ## Purpose This is a static front-end without a server, so load, stress and throughput testing do not apply (NFR scalability: N/A). Performance here means **page-load quality as a visitor experiences it**, measured with Lighthouse. ## Requirements (NFR-P-01) - **Performance**: ≥ 90 on every page, mobile and desktop. - **Temporary exception**: home page on mobile ≥ 80, until responsive images come from the API/CMS and prerendering exists. - **Accessibility, Best Practices**: 100 on every page. - **SEO**: 100 on indexed pages. On `noindex` pages only the "is crawlable" audit may fail. ## Run ```bash pnpm build pnpm lighthouse # mobile (lighthouserc.cjs), then desktop (lighthouserc.desktop.cjs) ``` - Lighthouse CI starts `pnpm preview` itself (port 4173, real security headers). - It measures all six routes plus `/bestaat-niet` (404) once per form factor. - It fails if any assertion fails. Exception: in CI the workflow sets `LIGHTHOUSE_PERFORMANCE=warn`, which makes Performance report-only, because the Raspberry Pi runner gives scores 30-40 points lower than a PC for the same build. Locally, Performance blocks. - Reports are written to `lighthouse-reports/mobile` and `lighthouse-reports/desktop` (git-ignored). Open the `.html` files for details. In CI they are attached to the run as the `lighthouse-reports` artifact. - Requires a local Chrome. Manual measurement in a browser: `pnpm build && pnpm preview`, then open `http://localhost:4173` in a **private window** (extensions and Brave Shields skew results) and run Lighthouse from DevTools. ## Results (2026-10-18, clean install) | Page | Mobile Perf | Desktop Perf | A11y | Best Pr. | SEO | |---|---|---|---|---|---| | `/` | **82** (target 80) | 99 | 100 | 100 | 100 | | `/over-mij`, `/portfolio`, `/soorten-fotoshoots`, `/contact`, `/privacyverklaring` | 94 | 100 | 100 | 100 | 69 (noindex, accepted) | | `/bestaat-niet` (404) | 95 | 100 | 100 | 100 | 58 (noindex, no description; accepted) | Home page mobile: LCP ≈ 4.3 s (simulated slow 4G), total download ≈ 1.2 MB, CLS ≈ 0. ## Known bottlenecks and follow-ups - **Responsive images**: the first hero photo is 2560 px wide (≈325 KB), also on a phone. The fix is image variants per width from the API/CMS or an image service, used via `srcset`. - **Render after JavaScript**: the hero title appears only after the JS bundle (≈170 kB gzip, mostly Chakra) has loaded. Prerendering (planned with hosting) fixes this. - **Already done in this feature**: - Hero slides load just-in-time (active, next, previous), so the download went from 2.6 MB to 1.2 MB. - The logo is sized correctly (`htmlWidth`/`htmlHeight`).