DEV Community

Ryan
Ryan

Posted on

3

Do validate your HTML

I'd been pulling my hair out trying to get a perfect score in Chrome's Lighthouse audit. I had only a few tiny icons, not many deeply nested elements, no blocking javascript, I had used preload tags to avoid request chains, and the page sure seemed fast to me. There was no reason I should be capped at 95 for performance. But the audit would always tell me 900ms was being spent on "Unattributable." Gee, very helpful!

A post I happened to read here on DEV linked the W3 Validator so I thought what the heck, let's see if anything is wrong, and ran my site through it. Sure enough I had a few mismatched tags. And wouldn't you know it, fixing that made the problem go away and showed me those beautiful fireworks.

Most browsers will silently fix mismatched tags, so you won't notice any errors on the site or console and it will even be corrected in the source code. But I suppose this makes the renderer waste some time re-parsing the DOM -- not enough for me to notice on my notebook, but substantial on Lighthouse's simulated slow device.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay