Commit Graph
14 Commits
Author SHA1 Message Date
tiago-neves 657e1c3bde fix(perf): BIT-28145 follow-up — wire sanitizer tests into npm test, defer non-critical scripts
Tests / writer-pipeline tests (push) Successful in 1m30s
Tests / frontend lib tests (pull_request) Successful in 1m22s
Tests / bridge tests (push) Successful in 1m30s
Tests / frontend lib tests (push) Successful in 1m30s
Tests / bridge tests (pull_request) Successful in 1m23s
Tests / writer-pipeline tests (pull_request) Successful in 1m23s
Post-merge Lighthouse re-verification of PR #47 confirmed article TBT
regression is resolved (7416ms -> 0-348ms, Performance 60 -> 99 median,
5 runs, results in PERFORMANCE_BASELINE.md). This follow-up closes a
gap found during that verification and widens the pass margin:

- bridge/package.json: sanitize-html.test.ts (added in the original
  fix) was never wired into the test/test:coverage scripts, so the
  "28 bridge sanitizer tests pass" claim wasn't actually exercised by
  npm test. Fixed.
- Defer mobile-menu and share-button click handlers to
  requestIdleCallback (institutional/sports headers, ArticleShareBar)
  so they don't compete with hydration-critical work.
- Split Base.astro's theme-flash-prevention script into a minimal
  inline snippet (runs before paint) and the deferred click-handler
  logic, instead of one blocking script.
- bridge articles route: /articles/:slug/related accepts an optional
  ?category_id= to skip a redundant WP post-by-slug fetch when the
  caller already has it.

Paperclip-Agent: Miguel Teixeira (urlKey miguel-teixeira; id 0f722e1a-bc3e-4381-8d98-76fa3c7aea10)
Paperclip-Issue: BIT-28145
2026-08-07 10:20:04 +01:00
spark 5fd457a75d Merge pull request 'fix(perf): BIT-28145 article page TBT 7416ms -> sanitize oEmbed HTML' (#47) from fix/BIT-28145-article-tbt into main
Tests / bridge tests (push) Successful in 1m2s
Tests / frontend lib tests (push) Successful in 1m2s
Tests / writer-pipeline tests (push) Successful in 1m3s
2026-08-05 19:01:40 +01:00
miguel-teixeira 1f4e2ae926 docs(perf): BIT-28144 re-measurement #2 — larger sample, article passes, home mostly passes
Tests / writer-pipeline tests (pull_request) Successful in 1m26s
Tests / frontend lib tests (push) Successful in 1m27s
Tests / bridge tests (push) Successful in 1m32s
Tests / writer-pipeline tests (push) Successful in 1m32s
Tests / bridge tests (pull_request) Successful in 1m16s
Tests / frontend lib tests (pull_request) Successful in 1m21s
2026-08-05 00:29:32 +01:00
miguel-teixeira 56f1a555f4 docs(perf): BIT-28144 root cause, fix, deploy + re-measurement addendum
Tests / writer-pipeline tests (push) Successful in 4m54s
Tests / bridge tests (push) Successful in 3m58s
Tests / frontend lib tests (push) Successful in 3m35s
Tests / writer-pipeline tests (pull_request) Successful in 2m31s
Tests / bridge tests (pull_request) Successful in 1m11s
Tests / frontend lib tests (pull_request) Successful in 1m10s
Root cause: FpaAgendaSection (andebol.net-only, up to 48 FPA agenda cards)
Style & Layout main-thread cost, fixed via content-visibility on
.fpa-agenda__card (PR #42, merged as 6b95f4d).

Also documents a separate but directly blocking finding: the ct222-news
deploy cron had been failing silently for ~24h (broken SSH deploy key,
never registered with Gitea) so 15+ merged PRs including this fix never
reached production. Fixed by switching to the standard HTTPS PAT +
credential-helper pattern from CT_DEPLOY_CREDENTIAL_ROTATION_BIT28016;
cron auto-recovered and deployed ec22a04 without further intervention.

Re-measurement is inconclusive on numeric pass/fail: this measurement
host was under heavy unrelated contention (load avg 48-60/24 cores),
confirmed by newsproject.bitreport.pt (a previously-verified-passing
control) also failing in the same session. Fix is confirmed live and
the targeted metric (Style & Layout) improved ~2x in the calmest runs;
authoritative re-verification needs PSI (quota-exhausted today) or a
quiet host window.

Paperclip-Issue: BIT-28144
2026-08-05 00:18:10 +01:00
Xika c792c746f5 docs: revise Free-plan HIT TTFB contract to <150ms (BIT-28133)
Tests / bridge tests (pull_request) Successful in 1m37s
Tests / writer-pipeline tests (pull_request) Successful in 1m39s
Tests / frontend lib tests (pull_request) Successful in 1m23s
Tests / bridge tests (push) Successful in 1m22s
Tests / writer-pipeline tests (push) Successful in 1m22s
Tests / frontend lib tests (push) Successful in 2m4s
Reconcile production SLA with Cloudflare Free measured HIT latency
(~81–130 ms). Keep <30 ms as aspirational only.
2026-08-04 23:41:20 +01:00
miguel-teixeira ee8405980c fix(perf): article TBT 7416ms — strip scripts/styles/iframes/event-handlers, lazy-load images, content-visibility
Tests / bridge tests (push) Successful in 40s
Tests / writer-pipeline tests (push) Successful in 50s
Tests / frontend lib tests (push) Successful in 1m42s
Tests / writer-pipeline tests (pull_request) Successful in 1m21s
Tests / bridge tests (pull_request) Successful in 1m23s
Tests / frontend lib tests (pull_request) Successful in 48s
BIT-28145: newsproject.bitreport.pt article template Total Blocking Time
was 7416ms (Lighthouse Performance 60) vs home 73ms (Performance 97).

Root cause: WordPress oEmbed HTML injected via set:html rendered <script>,
<style>, <link> tags, inline event handlers, and heavy <iframe> embeds
(Twitter, Instagram, YouTube) that blocked the main thread during HTML
parsing. The prior sanitizer only stripped <script> tags and added
loading=lazy to iframes — insufficient for the oEmbed payload.

Changes:
- Enhance bridge and frontend sanitizers to strip <style>, <link>,
  and inline event handlers (on* attributes) in addition to <script>
- Replace <iframe> elements with click-to-load placeholders (eliminates
  iframe document parsing cost from main thread)
- Add loading=lazy + decoding=async to <img> tags in article body
- Add content-visibility:auto to .article-body CSS (skip off-screen render)
- Add embed-placeholder styles in global.css + click handler in [slug].astro
- Parallelize article/related/trending bridge fetches
- Add preconnect hints for gravatar and featured images
- Document root cause in PERFORMANCE_BASELINE.md

Paperclip-Agent: Miguel Teixeira (urlKey miguel-teixeira; id 0f722e1a-bc3e-4381-8d98-76fa3c7aea10)
Paperclip-Issue: BIT-28145
2026-08-04 21:57:16 +01:00
José Alves 18d7f15efb docs: sync PROJECT_STATUS + baseline with BIT-28130 CWV results
Tests / writer-pipeline tests (push) Successful in 1m36s
Tests / bridge tests (push) Successful in 3m41s
Tests / frontend lib tests (push) Successful in 3m30s
Tests / writer-pipeline tests (pull_request) Successful in 46s
Tests / bridge tests (pull_request) Successful in 48s
Tests / frontend lib tests (pull_request) Successful in 47s
Incorporate August Lighthouse addendum and board statuses (BIT-28130 done;
follow-ups BIT-28144/28145) so docs do not claim CWV still unmeasured.

Paperclip-Issue: BIT-28131
Paperclip-Run: 73c52077-1860-4763-971f-b6d01d6dd8ac
2026-08-04 20:58:33 +01:00
José Alves 98132f77c4 docs: refresh PROJECT_STATUS + PERFORMANCE_BASELINE after BIT-28082
Tests / writer-pipeline tests (push) Successful in 2m29s
Tests / bridge tests (push) Successful in 3m22s
Tests / frontend lib tests (push) Successful in 3m3s
Align objectives matrix and open-work section with the Aug 2026 governance
sweep children; lead the performance baseline with May HIT evidence instead
of the superseded April cache-gap summary.

Paperclip-Issue: BIT-28131
Paperclip-Run: 52ceb27e-9eda-4fe2-92f2-3794e4a40d1c
2026-08-04 20:50:30 +01:00
Artur MoreiraandCursor 9b6029f369 docs: fix Cloudflare cache verification (GET vs HEAD) after BIT-21847
Document GET-based curl checks, Free-plan contains paths, and Edge TTL
note aligned with cf-cache-rules-apply.sh. Add baseline operator footnote
and independent HIT smoke.

Co-authored-by: Cursor <[email protected]>
2026-05-12 22:42:29 +00:00
Artur MoreiraandPaperclip a1107167d3 docs(perf): update PERFORMANCE_BASELINE.md with Cloudflare HIT measurements (BIT-21912)
Tests / writer-pipeline tests (push) Successful in 13s
Tests / bridge tests (push) Successful in 15s
Tests / frontend lib tests (push) Successful in 13s
Cache Rule applied 2026-05-12T22:39 UTC; both zones now return cf-cache-status:
HIT on repeat GET /. TTFB on HIT ~81-130 ms (down from ~220-380 ms DYNAMIC).

Co-Authored-By: Paperclip <[email protected]>
2026-05-12 22:40:57 +00:00
Artur MoreiraandCursor 95b3c1b703 docs(news-platform): tighten Cloudflare HTML cache runbook for BIT-21847
Add /api/ exclusion and per-zone filter expressions in deployment.md.
Record continuation verification in PERFORMANCE_BASELINE (still DYNAMIC).
Execution moves to Paperclip child BIT-21912 for DevOps dashboard apply.

Co-authored-by: Cursor <[email protected]>
2026-05-12 11:00:07 +00:00
Artur Moreira 740f3b38d6 docs(perf): update BIT-21610 addendum with fresh TTFB samples (2026-05-12 10:50 UTC)
Add 3-sample min/median/max TTFB measurements confirming ~220ms origin
latency. Both domains return cache-control: s-maxage=60, stale-while-revalidate=300.
Cloudflare edge caching (cf-cache-status: HIT) still pending Cache Rule
in BIT-21847.

Paperclip-Issue: BIT-21610
Paperclip-Run: $PAPERCLIP_RUN_ID
2026-05-12 10:51:25 +00:00
Artur Moreira 84821111e4 docs(perf): add 2026-05-12 re-measurement addendum to PERFORMANCE_BASELINE
Cache-Control headers (BIT-2261) confirmed live on both domains.
TTFB improved from ~300ms to ~220ms. Remaining gap: Cloudflare Cache
Rule needed for HTML caching (cf-cache-status still DYNAMIC).

Paperclip-Issue: BIT-21610
2026-05-12 07:26:02 +00:00
Artur MoreiraandPaperclip eff0aaa366 feat(frontend): add Cache-Control headers to all page routes (BIT-2261)
Set Cache-Control: s-maxage=60, stale-while-revalidate=300 on all page
routes to enable Cloudflare CDN caching per docs/architecture.md § 7.

Files updated:
- index.astro (homepage)
- article/[slug].astro (article pages)
- category/[slug].astro (category pages)
- noticias.astro (news listing)
- search.astro (search results)
- sitemap.xml.ts (sitemap)
- robots.txt.ts (robots)

This enables:
- CDN edge caching for 60 seconds (s-maxage)
- Serving stale content while revalidating for up to 300s (SWR)
- Improved TTFB for repeated requests (target: <30ms cache HIT)

Acceptance criteria:
✓ All page routes return correct Cache-Control header
✓ Cloudflare can cache responses with cf-cache-status: HIT
✓ TTFB improves to <30ms for cache HIT scenario
✓ Header values match architecture spec

Co-Authored-By: Paperclip <[email protected]>
2026-04-11 03:37:32 +00:00