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)
npminstall -g lighthouse
- Enter lighthouse http://yoursite.com – to display end result in
page, use command lighthouse -view http://yoursite.com (two hyphens) html
- 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
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
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
Remembering that above are some examples, there are several other command options that you can find in LightHouse help.