Tips for Improving Website Performance
Published on .
Use text whenever possible. Text is the fastest thing to render.
Avoid images whenever possible. If you need to use images, make sure you optimize them by reducing the size of the image. Squoosh can help you to optimize your images.
Avoid third-party code whenever possible. In other words, the production code is 100% your code. Third-party may contain a lot of stuff that your website does not use.
Avoid using frameworks. You should start a project without a framework. Use a framework when you have reasons to do so. Do not use a framework because it is popular or because everyone is using it. Do not bring everyone to justify your choice.
Avoid animations whenever possible. Animations can cause lags on low-end devices. My device is a low-end device so when I visit a website that has a lot of animations, my browser will stop immediately.
If you want to go extreme:
- Do not use JavaScript: If your website needs JavaScript, make sure it is not broken without JavaScript.
- Tiny CSS: Write as little CSS as possible. Keep your design as simple as possible. For personal websites, you can aim to have a stylesheet that is less than 30 Kilobytes (KB) uncompressed and non-minified size.
- No images: Images must not exist. They are the reasons why a website can have a heavy page weight.
- No custom fonts: Custom fonts can make your page weight bigger. So by not using them at all, you will have a light website.
The point is less is more. Less stuff on your website means more performance for your website.