4.2 KiB
Unit U6 — SEO and performance (added 2026-11-11, choices deliberately open)
Added at the request of the product owner after the interim test build. No technical choices have been made yet; this document records the goal, the current state, the options and the questions to settle before the unit is planned. Position in the order: after U5 (variant E), unless the owner moves it.
Goal
Make the public pages findable and fast: content visible to crawlers and to link previews without relying on JavaScript timing, structured data for the business and its packages, sensible indexing per environment, and measured performance budgets.
Current state (measured or read from the code, 2026-11-11)
- Client-rendered SPA (React, Vite, hash routing, one page).
index.htmlcontains only title, description andlang="nl"; hero, about, process and contact text are rendered by JavaScript. Packages are fetched from/api/v1/offeringsafter load. - Build output: JS 467 kB (152 kB gzip), CSS 59 kB; variant E is a separate lazy chunk; fonts self-hosted; the about photo is lazy with WebP variants.
- Missing:
robots.txt,sitemap.xml, canonical URL, Open Graph/Twitter tags, structured data (JSON-LD), favicon set. Test and production share one bundle, so nothing environment-specific (such as "do not index test") can be baked into the build today. - Accessibility is covered by unit tests (landmarks, contrast, focus, skip link); no Lighthouse or real screen-reader run has been done yet.
The central question: is pre-rendering the right choice when the content becomes (partly) dynamic?
Pre-rendering at build time freezes the content at the moment of the build. If packages (and later more text) come from the CMS, the HTML would be stale until the next build, unless a CMS change triggers a rebuild. So build-time pre-rendering is only right for content that changes together with a release.
Options to compare (none chosen):
| Option | What it is | Fresh content | Cost / risk |
|---|---|---|---|
| A. Build-time prerender of the static parts only | Hero, about, process, contact text in the HTML at build; dynamic blocks (packages) still client-side | static parts yes, dynamic no | small; packages stay invisible to crawlers that do not run JS |
| B. Build-time prerender plus a data snapshot | Build fetches the offerings and bakes them in; client refreshes on load | stale until rebuild; needs a rebuild trigger on CMS change | pipeline coupling to the CMS API |
| C. Render in the CMS host on request or on publish | The .NET host that already serves the site (WebsiteMode SpaFallback for SLP; PrerenderedPages exists for the Andrea host) serves HTML that includes current data |
yes | server-side work in the CMS repo; follows the pattern already used for Andrea |
| D. Client-only with JS-injected structured data | Keep the SPA; add JSON-LD, meta tags and sitemap, generated from the API data in the browser | yes, but depends on the crawler rendering JS | cheapest; weakest guarantee |
| E. Hybrid (A for static text + D or C for data) | Static text prerendered; dynamic parts via C or D | mixed | most flexible; two mechanisms |
Elements that are independent of that choice
robots.txt and indexing rules per environment (test must not be indexed), sitemap.xml, canonical URL, Open Graph/Twitter tags, favicon set, JSON-LD for the organisation, performance budget and a Lighthouse CI/measurement step, image dimensions and fetchpriority on the LCP element, font preloading for the display face.
Questions to settle before planning (not asked yet)
- Which parts of the page will really be dynamic, and how often do they change (packages only, or also texts)?
- Who serves the public HTML for SLP Software in production (the CMS host fallback or a separate static server), and can that host render HTML itself?
- How strict must "fresh within minutes" be for crawlers, versus "fresh at the next release"?
- How should test environments be kept out of search results (robots, headers, auth)?
- Is a measured Lighthouse score a release gate?
Requirements touched
New NFR group "SEO and performance" to be added to requirements.md when the unit is planned. Security Baseline applies to any new header or script (CSP, no new third-party scripts).