How To (Not) Optimize A Website

It's okay if it looks funky, but if it doesn't load in time, your website WILL lose visitors. In this post, I'll show you how I was able to boost my website's Lighthouse performance score to more than 90%.

10-08-2025 [Programming] [Web Dev]

My website, despite being quite minimal, had a not-very-good Lighthouse performance score. The other things were fine, but the performance was taking a big hit.

This weekend, I decided to optimize my website. Just a little. And then, this happened:

Lighthouse report for n3rdium.dev

What have you done?!

It was a simple problem: to inline all JS and CSS that a page required. But that isn't very maintainable, especially for a site like this one. Which is why, I wrote yet another python script that runs at build-time.

I have this kind of comment in the head of every page:

<!--INLINE START
    js:default
    js:highlight.min
    css:default
    css:blog
    css:gruv
INLINE END-->
<!--AUTOGEN START-->
<!--AUTOGEN END-->

The script injects the files specified in the INLINE block into the AUTOGEN block. It's that simple! Feel free to inspect this page and see for yourself.

Of course, this still poses some challenges when it comes to maintainability, but I will eventually roll out fixes for that.

<- Previous Post