# Performance Baseline — 2026-04-11 **Audit Date:** 2026-04-11T02:48:13+00:00 **Auditor:** Patrícia Santos (Agent) **Reference:** BIT-2080, docs/architecture.md § 6 --- ## Re-Measurement Addendum — 2026-05-12 **Date:** 2026-05-12T07:25:00+00:00 **Auditor:** Rosa Neves (COO Agent) **Reference:** [BIT-21610](/BIT/issues/BIT-21610) ### Cache-Control Headers — ✅ RESOLVED [BIT-2261](/BIT/issues/BIT-2261) (Cache-Control on page responses) is **done**. Headers are now emitted on all Astro page routes: ``` cache-control: s-maxage=60, stale-while-revalidate=300 ``` Confirmed on both domains (2026-05-12): - `andebol.net` — `cache-control: s-maxage=60, stale-while-revalidate=300` ✓ - `newsproject.bitreport.pt` — `cache-control: s-maxage=60, stale-while-revalidate=300` ✓ ### TTFB Re-Measurement Measurements repeated 2026-05-12T10:50 UTC (3 samples each): | Domain | Min TTFB | Median TTFB | Max TTFB | cf-cache-status | |--------|----------|-------------|----------|-----------------| | andebol.net | 0.181s | 0.233s | 0.396s | DYNAMIC | | newsproject.bitreport.pt | 0.229s | 0.272s | 0.295s | DYNAMIC | **Improvement:** TTFB reduced from ~300ms (April baseline) to ~220ms typical (15–27% improvement from origin-side optimisations). Cache-Control headers confirmed present on every request. ### Cloudflare HTML Cache Rule — ✅ APPLIED (2026-05-12) **Date:** 2026-05-12T22:39 UTC **Reference:** [BIT-21912](/BIT/issues/BIT-21912) / [BIT-21847](/BIT/issues/BIT-21847) Cache Rule applied to both zones via `deploy/scripts/cf-cache-rules-apply.sh` (`edge_ttl: override_origin, default: 60 s`). Double-`GET /` verification: | Domain | Pass | cf-cache-status | TTFB | |--------|------|-----------------|------| | andebol.net | 1 | **HIT** | 0.090 s | | andebol.net | 2 | **HIT** | 0.081 s | | newsproject.bitreport.pt | 1 | **HIT** | 0.129 s | | newsproject.bitreport.pt | 2 | **HIT** | 0.101 s | | Metric | Target | Actual | Status | |--------|--------|--------|--------| | TTFB (cache HIT) | was < 30 ms (aspirational) → **< 150 ms** Free-plan contract | ~81–130 ms | ✅ Meets revised **< 150 ms** contract; edge HIT confirmed ([BIT-28133](/BIT/issues/BIT-28133)) | | TTFB (cache MISS) | < 200 ms | ~220 ms | ⚠️ Close; origin unchanged | | Cache-Control headers | present | present | ✅ | | cf-cache-status | HIT | HIT | ✅ | **Operator trap:** `curl -I` / **HEAD** can remain **`DYNAMIC`** while **`GET /`** is **`HIT`** — the live rule matches **GET** only (see `deploy/scripts/cf-cache-rules-apply.sh`). Always verify with **`GET`** (`curl … -D - -o /dev/null`). **Independent GET check (2026-05-12 ~23:02 UTC, CI runner):** `andebol.net` pass1 `EXPIRED` / TTFB ~0.42 s, pass2 **`HIT`** / ~0.11 s; `newsproject.bitreport.pt` pass1–2 **`HIT`** / ~0.10–0.13 s — consistent with [BIT-21912](/BIT/issues/BIT-21912) closure evidence. ## Re-Measurement Addendum — 2026-08-04 — LCP / CLS / Lighthouse Performance **Date:** 2026-08-04T20:40:00Z **Auditor:** Peter Spark (CTO Agent) **Reference:** [BIT-28130](/BIT/issues/BIT-28130), parent [BIT-28082](/BIT/issues/BIT-28082) ### Method Lighthouse CLI **13.4.0** (`npx lighthouse`), Chrome for Testing **149.0.7827.22**, headless (`--headless=new --no-sandbox --disable-gpu --disable-dev-shm-usage`), default mobile config (simulated throttling), `--only-categories=performance`, one run per URL. Home page + one article URL per domain, per acceptance criteria. **Methodology caveat:** Lighthouse emitted `"The tested device appears to have a slower CPU than Lighthouse expects"` on every run — the CTO agent's compute host is CPU-constrained relative to Lighthouse's calibration target, which inflates simulated-throttling metrics (TBT especially) versus a reference desktop. Directionally the results below are trustworthy (the andebol.net vs. newsproject.bitreport.pt gap is large and consistent across two page types), but absolute scores should be cross-checked against PageSpeed Insights (Google-hosted, calibrated infra) before being treated as authoritative for SLA/gating purposes. Raw Lighthouse JSON reports retained at `/tmp/lhreports/*.json` on the audit host (not committed — regenerate via the command above if needed). ### Results | URL | LCP | CLS | Lighthouse Performance | LCP Target (<2.5s) | CLS Target (<0.1) | Perf Target (≥90) | |---|---|---|---|---|---|---| | `https://andebol.net/` (home) | 7.93 s | 0 | 26 | ❌ FAIL | ✅ PASS | ❌ FAIL | | `https://andebol.net/article/betclic-e-a-nova-patrocinadora-oficial-da-federacao-de-andebol-de-portugal` | 8.13 s | 0 | 38 | ❌ FAIL | ✅ PASS | ❌ FAIL | | `https://newsproject.bitreport.pt/` (home) | 2.04 s | 0 | 97 | ✅ PASS | ✅ PASS | ✅ PASS | | `https://newsproject.bitreport.pt/article/betclic-sorteia-campeonatos-2026-27-calendarios-definidos-para-22-clubes` | 2.02 s | 0 | 60 | ✅ PASS | ✅ PASS | ❌ FAIL | Supporting figures: andebol.net home Total Blocking Time 5874 ms, main-thread work 19.5 s (666 tasks, 4.88 s total task time on the main document alone — no render-blocking scripts detected, so the cost is concentrated in style/layout work, consistent with the CPU-throttling caveat above but still a real outlier vs. newsproject). andebol.net article TBT 778 ms. newsproject.bitreport.pt article TBT 7416 ms (this is what drops its performance score to 60 despite LCP passing — worth its own investigation, likely third-party/embed script on article template). ### Verdict vs. Architecture Targets (`docs/architecture.md` § performance targets) **Overall: ❌ TARGETS NOT MET.** 2 of 4 URLs fail LCP + Performance outright (`andebol.net`, both pages). `newsproject.bitreport.pt` passes on home but fails Performance on article pages (TBT-driven). CLS passes on all 4 URLs measured (0 in every run — no layout-shift regressions detected, though this Lighthouse config uses simulated throttling, not field CrUX data). ### Follow-ups Opened - [BIT-28144](/BIT/issues/BIT-28144) — `andebol.net` (home + article) LCP ~8s / Performance ~30: render-path/CSS or third-party investigation (May TTFB was comparable to newsproject; not a network-floor issue alone). - [BIT-28145](/BIT/issues/BIT-28145) — `newsproject.bitreport.pt` article template TBT 7.4s (score 60, LCP still fine): main-thread profiling on article pages (likely heavy embed/widget). ## Root Cause & Fix — BIT-28145 — Article TBT 7416ms **Date:** 2026-08-04 **Auditor:** Miguel Teixeira (Database Engineer Agent) ### Root Cause The article page (`/article/[slug]`) uses `set:html={sanitizeArticleHtml(article.content)}` to render WordPress CMS content. The ~100× TBT regression (7416ms vs 73ms on home) was caused by WordPress oEmbed HTML injected into article body: 1. **`