DEV Community

Cover image for Scoring 100 on Lighthouse (Performance focused)
Manujdixit
Manujdixit

Posted on

Scoring 100 on Lighthouse (Performance focused)

“Why aim for 100? Because Google loves fast websites more than devs love dark mode.”

If you also stared at a Lighthouse score of 28 and thought “what kind of shit I had written”, this post is for you.


🤔 What Even Is Lighthouse?

Lighthouse is Google’s brutally honest friend. It audits your site for:

  • Performance
  • SEO
  • Accessibility
  • Best Practices
  • PWA readiness

Drake Meme – JS ≠ fast vs. no JS = fast


⚙️ How to Run Lighthouse

  • Chrome DevTools Right-click → Inspect → Lighthouse tab → Click “Analyze”

⚡ Performance: How to Reach 100 Without Losing Mind

1. Code Splitting

  • Remove unused libraries/imports.
  • Split JS using React.lazy() or next/dynamic

    Dynamic import

  • Avoid unnecessary animations on load

  • Implement session based caching for less frquently updated data.

// import specific parts

// bad practice- import radixui from "radix-ui"

// good practice
import Switch from "@radixui/switch"
Enter fullscreen mode Exit fullscreen mode
  • For manual treeshaking in nextjs-

Treeshaking

 ANALYZE=true npm run build
Enter fullscreen mode Exit fullscreen mode

Big modules
Bigger colored boxes increase your bundle size and oftenly impact performance also. To optimize dynamically import them.


2. Optimize Apis

  • Reduce the size of response by returning only required fields(or further more reducing its size by gziping it)

    selecting only required fields to query from db

  • Implementing caching for less freuently updated data.

    caching

  • Avoid Shitty Orms like prisma, typeorm etc. As they make your queries slower with heavy engines, slower query execution speed, lack of proper joins. (I had started using drizzle for migrations and kysely as sql query builder, responses are 10x faster as compared to prisma and 3-4x faster to typeorm).


2. 🖼️ Optimize Your Largest Contentful Paint (LCP)

LCP = how fast your main content loads (target: < 2.5s)

  • Compress images (.webp > .jpg)
  • Lazy load offscreen images
  • Serve static assets from a CDN

lcp

Slow LCP
LCP is like your first impression on a date — don’t show up blurry or late.


3. ⏱️ Use defer and Lazy Load Smartly

<script defer src="/scripts/main.js"></script>
<img loading="lazy" src="/images/offscreen.jpg" />
Enter fullscreen mode Exit fullscreen mode

“Don’t serve dessert before the main course.” 🍰


4. 🥇 Preload Fonts & Key Assets

<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin>
Enter fullscreen mode Exit fullscreen mode

🔍 SEO: Make Googlebot Fall in Love With You

1. 🎯 Proper <title> & <meta description>

Each page should have proper title and meta description.

metadata

Confused math lady meme
“Googlebot trying to index your page with no title tag…”


2. 🧩 Use Semantic HTML

Use proper tags like <header>, <nav>, <main>, <article>, <footer>.

Analogy:
Semantic tags are like labeled boxes during moving — they help Googlebot know what’s inside.


3. 🧭 Descriptive Link Text

Bad:

<a href="/more">Click here</a>
Enter fullscreen mode Exit fullscreen mode

Good:

<a href="/about-us">Learn more about our team</a>
Enter fullscreen mode Exit fullscreen mode

“Click here” links are the SEO version of mystery boxes.


4. 📱 Mobile Friendliness

Make sure your layout adapts well to all screen sizes.


🧰 Bonus Tools to Save Your Sanity


🏁 Final Thoughts

Getting a 100 Lighthouse score isn’t just for bragging rights — it helps with:

  • ⚡ Blazing fast user experience
  • 🔍 Higher SEO rankings
  • 📈 Better engagement + conversions

“A slow site is like a waiter who brings water after dessert. Nobody comes back.”

Top comments (18)

Collapse
 
adi73 profile image
Aditya • Edited

I recently fixed my lighthouse ratings for my upcoming project - trekyourworld

Collapse
 
manujdixit profile image
Manujdixit

Nice bro

Collapse
 
dariomannu profile image
Dario Mannu

There is a chance fine-tuning web performance to these levels might soon become irrelevant for quite a few websites as people shift from search engines to LLMs/agents and possibly don't even land on those sites at all...

Collapse
 
manujdixit profile image
Manujdixit

Yes the shift is happening. I have heard about seo for llms (llm.txt, etc ) never tried though 😅

Collapse
 
ravavyr profile image
Ravavyr

These are not bad tips, but this is only good if you're a dev building something for your self.
If you're at a company and the marketing team wants to add googel analytics, hotjar, fullstory, klaviyo etc etc etc.... you just never get to have 100 on performance.

Generally an 80+ is good enough, as long as your page renders in under 2 seconds.
Focus on that.

Collapse
 
manujdixit profile image
Manujdixit

Can lazyloading the tag managers help?

Collapse
 
mileswk profile image
MilesWK


mileswk.com results aren't pretty. Good thing I am starting work on a new version.

Collapse
 
gamelord2011 profile image
Reid Burton

I got mid results for accesibility and performance, perfect seo and bets practices tho.

Collapse
 
manujdixit profile image
Manujdixit

Excited to see the revamp! Let me know if you’d like any help along the way 🚀

Collapse
 
hackman01 profile image
Aman Maurya

Very Informative!!...Definitely enhanced my understanding of web optimization.

Collapse
 
manujdixit profile image
Manujdixit

Thanks a lot, Aman! Glad it helped 😊

Collapse
 
dvjosefr profile image
Josef Röyem

Well done, core web vitals are really important. You would be surprised how many startup websites have poor vitals.

Collapse
 
parag_nandy_roy profile image
Parag Nandy Roy

pure gold and practical..

Collapse
 
manujdixit profile image
Manujdixit

Thanks for the words

Collapse
 
kurealnum profile image
Oscar

I always forget to add descriptive link text. I also never convert my images to webp (which I really need to start doing!)

Collapse
 
manujdixit profile image
Manujdixit

Converting images is a pain 😅

Some comments may only be visible to logged-in visitors. Sign in to view all comments.