Adds the build and test documents of the prerendering feature
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+90
@@ -0,0 +1,90 @@
|
||||
# Performance Test Instructions
|
||||
|
||||
Feature: prerendering. Lighthouse was **not run** in this stage. Two sets of figures exist and they must not be mixed:
|
||||
- **Reference measurement** (`construction/hosting-and-targets/code/measurement-final.md`): 3 runs per URL, median, on the author's PC, commit `6d4d012`, 2026-11-01. This is where scores can be compared with master.
|
||||
- **CI run 599** (commit `2006fa0`, Pi runner, 1 run per URL): scores are much lower and only warn. They are not comparable with the reference measurement.
|
||||
|
||||
## Purpose
|
||||
Check the Lighthouse budgets of the 12 URLs with the three units combined. This is a static site: there is no load or stress test, because there is no server-side work to load. The goal of the feature is faster first paint and better SEO by serving prerendered HTML (NFR-PR-P-01 to P-04).
|
||||
|
||||
## Performance Requirements
|
||||
Targets after the owner's decisions of 2026-11-01 (`web/lighthouserc.cjs`, each URL matches exactly one entry):
|
||||
|
||||
| URL | Mobile target |
|
||||
|---|---|
|
||||
| `/` | 0.85 (raised from 0.8; kept at the current score until responsive photos) |
|
||||
| `/soorten-fotoshoots/zwangerschap`, `/gezin`, `/loveshoot`, `/portret` | 0.85 |
|
||||
| All other indexed pages and the not-found page | 0.9 |
|
||||
|
||||
- **Desktop** (`lighthouserc.desktop.cjs`): 0.9 on all 12 URLs.
|
||||
- **Accessibility, best practices**: 1 on every URL. **SEO**: 1 on indexed pages; `/privacyverklaring` and the not-found page deliberately fail `is-crawlable` (noindex).
|
||||
- `numberOfRuns` is 1.
|
||||
|
||||
## Setup Performance Test Environment
|
||||
|
||||
### 1. Prepare Test Environment
|
||||
- Build first (`pnpm build`). Lighthouse runs against the built site through `config/previewServer.ts`, started by Lighthouse CI with `--audit-route` (the not-found page is audited at `/__audit/404`, because Lighthouse refuses a page with status 404 and `/404.html` is a real 404 now).
|
||||
- Port 4173 must be free (`--strictPort`).
|
||||
- Chrome must be installed. In the CI container Chrome needs `LIGHTHOUSE_CHROME_FLAGS='--no-sandbox --headless=new --disable-dev-shm-usage'`.
|
||||
|
||||
### 2. Configure Test Parameters
|
||||
- **Strictness**: locally `LIGHTHOUSE_PERFORMANCE` is unset, so a performance miss fails the run. In CI it is `warn`.
|
||||
- **Reports**: `web/lighthouse-reports/mobile/` and `.../desktop/` (HTML and JSON); the CI job uploads them as artifact `lighthouse-reports` (50 files, 14 days).
|
||||
|
||||
## Run Performance Tests
|
||||
|
||||
### 1. Execute Lighthouse (mobile and desktop)
|
||||
```bash
|
||||
cd web
|
||||
pnpm build
|
||||
pnpm lighthouse
|
||||
```
|
||||
`pnpm lighthouse` is `lhci autorun && lhci autorun --config=lighthouserc.desktop.cjs`. For a more reliable local reading use 3 runs: `pnpm exec lhci collect --numberOfRuns=3` per preset, and compare medians.
|
||||
|
||||
### 2. Execute the Gate
|
||||
```bash
|
||||
cd web
|
||||
pnpm check
|
||||
```
|
||||
Runs lint, format, tests, build, browser tests, both audits and Lighthouse. `/` sits exactly at its 0.85 target with one run, so a slow local run can fail `pnpm check`.
|
||||
|
||||
### 3. Analyze Performance Results
|
||||
|
||||
**Reference measurement** (author's PC, 3 runs, median; master / after unit 1 / final):
|
||||
|
||||
| URL | Mobile score master / unit 1 / final | Mobile LCP ms master / final | Target | Status |
|
||||
|---|---|---|---|---|
|
||||
| `/` | 0.75 / 0.85 / 0.85 | 4293 / 4357 | 0.85 | pass, exactly at target |
|
||||
| `/over-mij` | 0.86 / 0.90 / 0.92 | 3535 / 3233 | 0.9 | pass |
|
||||
| `/portfolio` | 0.90 / 0.94 / 0.93 | 2926 / 3232 | 0.9 | pass |
|
||||
| `/soorten-fotoshoots` | 0.85 / 0.89 / 0.92 | 3750 / 3306 | 0.9 | pass |
|
||||
| `.../newborn` | 0.85 / 0.90 / 0.91 | 3525 / 3457 | 0.9 | pass |
|
||||
| `.../zwangerschap` | 0.84 / 0.88 / 0.90 | 3676 / 3606 | 0.85 | pass |
|
||||
| `.../gezin` | 0.84 / 0.88 / 0.89 | 3678 / 3681 | 0.85 | pass |
|
||||
| `.../loveshoot` | 0.82 / 0.86 / 0.88 | 3768 / 3831 | 0.85 | pass |
|
||||
| `.../portret` | 0.84 / 0.89 / 0.90 | 3673 / 3606 | 0.85 | pass |
|
||||
| `/contact` | 0.87 / 0.94 / 0.94 | 3345 / 3007 | 0.9 | pass |
|
||||
| `/privacyverklaring` | 0.90 / 0.96 / 0.96 | 2844 / 2780 | 0.9 | pass |
|
||||
| Not found | 0.91 / 0.97 / 0.97 | 2603 / 2630 | 0.9 | pass |
|
||||
|
||||
- FCP on mobile fell from about 2.5 to 2.7 s (master) to about 1.36 s (final) on every page; TBT from 114 to 293 ms to 61 to 75 ms. CLS stays at 0.021 or lower.
|
||||
- Desktop: 0.99 or 1.00 on all 12 URLs.
|
||||
- Accessibility 1 and best practices 1 on every URL, all runs; SEO 1 on the ten indexed pages.
|
||||
- `lhci assert` on these reports (36 mobile and 36 desktop): all 12 URLs pass in both presets.
|
||||
- LCP itself did not improve on every page (for example `/` 4293 to 4357 ms, gezin and loveshoot slightly later); the score gain comes from FCP and TBT.
|
||||
|
||||
**CI run 599** (Pi runner, 1 run, warnings only, the job succeeded):
|
||||
- Mobile performance 0.47 to 0.66 on the 12 URLs (`/` 0.49, `/over-mij` 0.53, `/portfolio` 0.61, gezin 0.47, `/privacyverklaring` 0.66, not found 0.59). Every URL warned.
|
||||
- Desktop performance 0.71 to 0.81 on the 12 URLs (`/` 0.71, `/privacyverklaring` 0.8, not found 0.81). Every URL warned.
|
||||
- The workflow comment says performance on the Pi is not representative (CPU slowdown on a slow machine); that is the reason it only warns there. These numbers say nothing about the feature and are not a regression against the PC figures. They also cannot show an improvement.
|
||||
- Accessibility, best practices and SEO assertions: passed (no error reported; the job succeeded).
|
||||
|
||||
**Bundle**: main bundle 547,302 bytes raw, 155,603 bytes gzip on the wire (test server, after run 598). Master's figure was not re-measured in this stage.
|
||||
|
||||
**Results Location**: `construction/hosting-and-targets/code/measurement-final.md` (and `measurement-baseline.md`, `measurement-gate.md`, `measurement-display.md` in the other units' folders); CI artifact `lighthouse-reports` of run 599.
|
||||
|
||||
## Performance Optimization
|
||||
Open items (owner decisions already recorded; nothing to fix in this stage):
|
||||
1. `/` is exactly at 0.85 with `numberOfRuns: 1`; responsive photos are the planned way to remove the exceptions of `/`, gezin and loveshoot.
|
||||
2. zwangerschap and portret score 0.90 and keep a 0.85 target only because one run is unreliable near 0.90.
|
||||
3. Production compression was not part of the PC measurements (they ran with gzip on the preview server). The test server sends gzip, as the curl checks show.
|
||||
Reference in New Issue
Block a user