1 RESULT
SEOSpeed - SEO Contest uWelcome2019

Improving Page Speed with Lighthouse

We already know that Google uses page speed as one of the ranking factors in organic search results.

We at SEO Contest uWelcome2019 discuss a lot the new emerging SEO techniques, and although the Page Speed is out there for a long time (seriously, almost 10 years), it became more important than never in the last year with the roll-out of the Mobile First Index.

In this article, you will learn about Page Speed ​​as a Mobile Ranking Factor on Google and how to use tools to measure the speed of your site and check which performance-affecting issues need to be fixed.

One of the tools mentioned is LightHouse, which can be used from the extension of Chrome or through the command line. I tested this time for the second option and I’ll tell you how to use LightHouse through Node.js.

What is Google LightHouse?

Lighthouse is an automated open source tool that enhances the quality of web apps. It can run as a Chrome extension or at the command line. Tell Lighthouse a URL you want to audit. It will run a series of tests on the page and generate a report on page performance. In this report, you can use the tests that failed as indicators of what can be done to improve the application.

Lighthouse can be run in two ways: as an extension of Chrome or as a command line tool. The Chrome extension offers an easier-to-use interface for reading reports. The command line tool allows you to integrate the Lighthouse into seamless integration systems.

I find it interesting to test in different ways, but this is a private option – if you do not have as much command-line skill or do not have IT staff for such actions, the Chrome extension is simple to use and should bring the same results.

Improving Page Speed with Node.js and LightHouse

I ran the test on Windows and, if you use Linux, you’re even more familiar with the command line. Here are the steps:

  • Download and install Node.js from the official site
  • Open Command Prompt Node.js (search only in the Windows search box)
  • Enter npm install -g lighthouse
  • Enter lighthouse http://yoursite.com – to display end result in html page, use command lighthouse -view http://yoursite.com (two hyphens)
  • As topics are traced, the status is displayed on each line. Google Chrome will open during testing and the site will load – by the end of the scan, Chrome will automatically close.

Google LightHouse Result Report

If you have chosen to use the lighthouse -view http://yoursite.com command line, an html file with LightHouse scan result will be saved to your computer. Check out the example of the report with SEO News site, emulated by the tool in the environment below.

Environment emulated by Google LightHouse

See that I have several items to improve, remembering that this site is not PWA, so disregard the note for Progressive Web App:

Google LightHouse Result Report

After the summary, there is in detail everything that should be checked and corrected for each topic.

More Test Options with LightHouse
When you enter the lighthouse -help command line, all options that you can use while testing your site with LightHouse are displayed. Some examples I tested:

lighthouse http://yoursite.com -output json (two hyphens): the result of the scan is displayed in Json format – this format is useful for computer systems where you want to process the report information automatically. By putting csv in place of json on the command line, the result is saved to your computer in CSV format (Excel format).

Google Lighthouse – Result in CSV

lighthouse http://seusite.com.br -only-categories performance (two hyphens before only): only the Performance topic will be evaluated. If this parameter is not informed, we will evaluate: Performance, PWA, Accessibility, Best Practices and SEO. But you may want to have less information in the report and specify which (other than performance) through the -only-categories parameter.

Remembering that above are some examples, there are several other command options that you can find in LightHouse help.