Root cause: WordPress oEmbed HTML in article body (style/link tags, inline event handlers, heavy iframes, unlazy images) was driving Total Blocking Time to 7416ms on article pages vs 73ms on home (Lighthouse Performance 60 vs target >=90).
Fix: strip <style>/<link> blocks and inline on* handlers from sanitized article HTML, replace <iframe> embeds with click-to-load placeholders, add loading="lazy"/decoding="async" to images, and content-visibility: auto on .article-body.
## Summary
- Root cause: WordPress oEmbed HTML in article body (style/link tags, inline event handlers, heavy iframes, unlazy images) was driving Total Blocking Time to 7416ms on article pages vs 73ms on home (Lighthouse Performance 60 vs target >=90).
- Fix: strip `<style>`/`<link>` blocks and inline `on*` handlers from sanitized article HTML, replace `<iframe>` embeds with click-to-load placeholders, add `loading="lazy"`/`decoding="async"` to images, and `content-visibility: auto` on `.article-body`.
## Test plan
- [x] 28 bridge sanitizer tests pass (new coverage: style/link/event-handler stripping, iframe placeholders, image lazy loading)
- [x] 47 frontend tests pass
- [x] Astro build succeeds
- [ ] Deploy + re-run Lighthouse to confirm Performance >= 90 on article pages (post-merge)
- [ ] Flush/expire Bridge Redis cache for previously-cached article HTML in production (post-merge)
Related: BIT-28130 (measurement), BIT-28145 (this issue).
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
<style>/<link>blocks and inlineon*handlers from sanitized article HTML, replace<iframe>embeds with click-to-load placeholders, addloading="lazy"/decoding="async"to images, andcontent-visibility: autoon.article-body.Test plan
Related: BIT-28130 (measurement), BIT-28145 (this issue).
auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
auto-approve: CI success (gitea_auto_approve_open_prs_once.py)