5.8 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?
Answers of the product owner (2026-11-11)
- Dynamic parts (revised later on 2026-11-11, replaces "still unclear"): SLP Software has static text with some dynamic parts such as the packages. The Andrea Slop Fotografie site is the same, and will later get a dynamic gallery as well; texts becoming dynamic is a possibility further out and is not to be designed for now. This points to option E (hybrid): prerender the static text at build time, fill the dynamic parts (packages, later the gallery) from current data.
- Who serves the HTML: answered from the repo and the hosts, not by the owner. The SLP test host (and production, same application) serves the SPA through the .NET CMS host, so it can render HTML itself. The owner's remark about an IIS host concerns the Andrea Slop Fotografie site (IIS production hosting), not SLP Software: to be confirmed with the owner.
- Freshness: ideally within minutes. Whether that is achievable on an IIS host is the open point for the ASF site; for SLP the CMS host can render per request or on publish (option C or the dynamic half of E).
- Test environments:
robots.txtwithDisallow: /plus anX-Robots-Tag: noindexheader on test hosts, served by the host (environment-specific), not baked into the shared bundle. No password protection. - Lighthouse: same as the ASF site (
web/lighthouserc.cjs,lighthouserc.desktop.cjs): measured in the pipeline on the built site, mobile and desktop, a hard gate with a minimum score of 0.9 per category; exceptions only with a recorded owner decision and a floor, per page.
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).