惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
腾讯CDC
A
About on SuperTechFans
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
D
DataBreaches.Net
D
Docker
宝玉的分享
宝玉的分享
量子位
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
博客园 - 三生石上(FineUI控件)
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
Last Week in AI
Last Week in AI
H
Help Net Security
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Fixed a 42/100 Lighthouse Score on a B2B 3D WebGL L...
Tan Phan · 2026-04-26 · via DEV Community

Tan Phan

A few weeks ago, I was building a B2B landing page that embedded an industrial 3D model using <model-viewer>. The page looked fantastic. Then I ran Lighthouse.

Score: 42/100.

Here are the silent killers I found - and what made them non-obvious:

1. The Font Weight Trap (8 requests instead of 3)

Google Fonts was loading wght@300;400;500;600;700;800. That's 6 weights for Inter plus 2 for JetBrains Mono = 8 separate HTTP requests just for fonts.
Each one is render-blocking.
The fix: Reduce to exactly the weights used (400;600;700). Saved ~400ms.

2. <model-viewer> Blocking the Main Thread

The WebGL script was 300KB. Sitting right in the <head>.
The fix: Move it to the very end of the <body>. Use type="module" so the browser defers it automatically.

3. The Silent SEO Killer: JavaScript in JSON-LD

This was the nastiest bug.
A background animation (Particle.js) was running on the page. Due to a weird timing issue, it injected callback code directly into my <script type="application/ld+json"> block.
The page looked perfect visually. No console errors. But the JSON-LD was now invalid. Google Search Console quietly dropped my rich snippets for 3 months before I noticed.


The Open-Source Fix: web-performance-surgeon

I got tired of hunting these issues manually, so I built a Python CLI that scans your HTML and auto-fixes all of them in one go:

# Audit only - shows all issues
python web_performance_surgeon.py index.html

# Audit + auto-fix everything
python web_performance_surgeon.py index.html --fix

Enter fullscreen mode Exit fullscreen mode

Final score after fixes: 100/100 Lighthouse.

I've open-sourced this tool along with my entire B2B web toolchain (including a JSON-LD guardian that specifically catches the injection bug):
GitHub: tanphan1105/web-performance-surgeon

Has anyone else run into that JSON-LD corruption bug? It's terrifying how silently it fails.