# U6 SEO and performance: plan (draft for approval) Basis: owner answers in `inception/application-design/unit-u6-seo-and-performance.md` (option E, hybrid). ## Approach - **Static text** (hero, about, process, contact, variant-neutral copy): prerendered into `index.html` at build time (React `renderToString` of the default Variant B shell in a post-build script; the client hydrates). Variant E (easter egg) stays client-only and is not indexed content. - **Dynamic parts** (packages now, gallery later): the CMS host (WebsiteMode `SpaFallback` for SLP) injects current data into the served HTML (JSON-LD `Offer` list plus the package markup placeholder) per request with a short cache (target: fresh within minutes). The client still fetches `/api/v1/offerings` and takes over. If the host injection is not available yet, the page degrades to static text plus client-side packages (no breakage). - **Per-environment rules from the host, not the bundle**: test hosts serve `robots.txt` `Disallow: /` and `X-Robots-Tag: noindex`; production serves `robots.txt` with sitemap reference. No password protection. ## Work split | Part | Website repo | CMS repo (`slp-modular-cms`) | |---|---|---| | Prerender static HTML | build script, hydration, tests | - | | Meta: canonical, Open Graph, Twitter, favicon set, theme-color | `index.html` + build | host fills absolute URLs from the request host | | JSON-LD Organization / LocalBusiness | static in build | - | | JSON-LD offers + packages HTML injection | placeholder markers | host injection with cache | | `robots.txt`, `sitemap.xml`, `X-Robots-Tag` | - | host, per environment setting | | Performance: LCP image dimensions + `fetchpriority`, display-font preload, chunk budget | yes | cache headers for hashed assets | | Lighthouse gate (mobile + desktop, >= 0.9 per category, as ASF) | `lighthouserc*.cjs` + pipeline job on the built site | - | ## Steps 1. Add NFR group "SEO and performance" to `requirements.md` (below) and get approval of this plan. 2. Website: meta tags, favicon set, JSON-LD organisation, LCP and font preload. 3. Website: prerender script + hydration; tests that the HTML contains hero/about/process/contact text and no duplicate ids. 4. CMS (via CMS session): robots/sitemap/`X-Robots-Tag` per environment; packages + JSON-LD injection with short cache. Contract: marker comments in `index.html`. 5. Website pipeline: Lighthouse job (mobile + desktop, hard gate 0.9), runs on any runner (`linux`). 6. Verify on test: crawler view (`curl`), Lighthouse results, `noindex` header, CSP unchanged (no new third-party scripts). 7. Production only on explicit owner go. ## Risks - Hydration mismatch between prerendered and client output (theme, variant, date): prerender only the default Variant B/light shell; theme applied after hydration. - Hash routing stays (single page); sitemap lists the one URL plus the privacy page if it gets a real URL. - Host injection needs CMS work and a deploy to both hosts; ASF has the same pattern later (gallery), so keep the marker contract generic. ## Decisions of the owner (2026-11-11) - Plan approved; start with the website part. - The privacy page becomes a **real URL `/privacy`** (sitemap lists `/` and `/privacy`). Consequence: path routing for that page (or a prerendered static page) instead of the hash route; the CMS host must serve `/privacy` (SpaFallback already covers it). Keep `#` anchors for sections of the home page. NFR-8 "hash routing remains" is relaxed for the privacy page only. - Canonical domain: `https://slpsoftware.nl`. - Production host: currently the .NET CMS host; **possibly IIS later**. So the marker contract for dynamic data must not depend on the .NET host only: keep the build-time option (as the ASF site does: build fetches the data, rebuild on change) as a fallback design, and look at how ASF solved it.