Optimize web page speed to improve Google Page Insight score

Web page speed is one of the most important things when you are developing a website, it can be quite easy to oversee some things! Never miss them again!


Similar tags

server hosting e-commerce google page speed php bug network domain coding tips web development seo explained wordpress css

More posts

How to optimise images for your website
07 Apr 2025 4 minutes read 1.1k views

How to optimise images for your website

Learn how to optimise images for the web using modern techniques like WebP format and lazy loading. Improve your site’s loading speed, boost SEO, and enhance user experience with these simple yet effective strategies.

How to become a web developer – a beginners guide
19 Apr 2020 7 minutes read 2.6k views

How to become a web developer – a beginners guide

Lately, many people are deciding to change their professions and become developers. And I understand them. But getting started can be quite daunting! That is why I have decided to write a small guide on how to become a developer.

Image lazy loading – How to implement it with Javascript
15 May 2020 5 minutes read 1.9k views

Image lazy loading – How to implement it with Javascript

Image lazy loading is must in modern web development. This might and will affect your website SEO score. And can be easily implemented with a Javascript!

How to optimize web page speed? How hard it is will depend on the system that lays beneath the surface of your website. Therefore, a system that is quite simple is usually easier to optimize.

Before you start, it would be good to test your website and remember the score. The best way to test it using Google Page Insight, GTmetrix, and Pingdom Tools. Everything that lights up as "green" (90 - 100) in your results may be considered a good result. When your score is more "orange" (50 - 89) - you will need some improvements. On the other hand, if your score is "red" (0 - 49) you are in a dire need for some improvements.

So it is time to start now. The most important thing that I pay close attention to is website size. Larger the web page, slower the load time. In general, pages over 1MB tend to perform worse than pages that are around 500KB, But sometimes, we can not avoid large pages - a simple example is a store category page with 30 products. How can we avoid load there?

Working with large data with may queries and complex logic

This is one of the most critical points when it comes to your web page speed. It can also be the one that is hardest to improve. But how can you do it?

You can always try and use Redis (or products similar to it) in order to improve your database speed. Also, try to keep your queries as simple as possible and of course - index your database.

In the worst-case scenario, you can always increase your server memory size and CPU power to improve your score. You can even go as far as implementing multiple servers with load balancers. Of course, you can find out more about the workings of servers here.

Load only things that are most important, and load large assets later

Usually, the largest assets on your web page are images. Why wouldn't you load them afterward? You can find more about how to "lazy load" images on your website in this post. That method can easily improve your score by a lot.

Moving blocking resources to bottom of the page

Your Javascript should live at the bottom of the page. Here you can use JS to load your Google Web fonts after the page load. It can speed up your web page and it is easy to implement!

Avoiding an excessive DOM size and use combine & minify

I've seen this quite a few times. Pages with over 5.000 DOM elements. Please keep in mind that your browser needs some time to render all elements and "paint" them using CSS. It is best to keep your DOM as simple as possible as well as your CSS. Less work for browser, better the score!

Another thing which I've also seen quite a few times, people using none minified CSS files (plural). Combining your CSS files into one large file and minifying it can be an easy job and it can improve your web page score! The same rule applies to Javascript files.

Use compressions and server cache policy

I am going to show you how you can do it using Nginx. Here is a section from a simple config file used in the Nginx configuration.


location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico)$ {
    expires 120d;
    add_header Cache-Control "public, no-transform";
}
gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
    text/plain
    text/css
    text/js
    text/xml
    text/javascript
    application/javascript
    application/json
    application/xml
    application/rss+xml
    image/svg+xml;