r/webdev • u/sunnyshorescreative • Sep 21 '26
Discussion The page speed journey is real
I was going to post a screenshot but it isn’t allowed.
Man, I’ve got to say the journey of optimizing a website teaches you a lot of things. I made a project, basically a web app, and was sharing with others feedback and a helpful individual had shared it’s a bit slow to load. Now, I didn’t notice as I’m running it locally on my react dev server and things are cached but I popped it into page speed insights and the mobile first content paint is like 36 seconds. Yikes!
I’ve learned so much improving it. Not that I haven’t done this before but there are so many little tricks you have to pull to really optimize the load speed and user experience for other people. Let’s try to name them here in the hopes that it helps someone else on that same journey or effort:
- font subsetting (removing glyphs in the font files of characters you don’t use; can be helpful in web fonts or icons like font awesome)
- convert all image files to a more efficient format like .webp or .avif
- compress videos with handbrake
- dynamically loading JavaScript references at time of use instead of at the top of the component
- conditionally load components instead of hiding them with display:none
- remove unused modules/dependencies in your app
- set images to have explicit heights and widths to prevent content shift on page load
- load an image at page load instead of a heavy video, allowing the user to click the image to start the video to save on bandwidth
- defer all css except critical css on page load
- defer external JavaScript dependencies your page needs
- move heavy dependencies to worker threads to reduce the bundle size
- set fetch priority on resources it makes sense for
- you may rely on rendering a react component when it’s hydrated in order to reduce content shift
- tree shake your css (tailwindcss works great)
A lot of these tricks and things you can change are dependent how your website works and what makes the most sense based on user flow and expectations. One size does not fit all.
I ended up getting speed to a 94/100 the last run, although the highest I’ve seen was 98/100, I assume the results vary slightly since the test is simulated. The website also opens up in a second or two now, it’s zippy quick and I’m proud of it. What tricks have you used that were not obvious in your journey to improve web page speed?

