A new tool by Google is to test and give you the recommendation to improve performance, SEO, security, best practices, and accessibility.
Google recently launched Lighthouse, an open-source tool to audit your website manually and automatically.
There are more than 75 metrics it tests and gives you overall scoring. Some of the following popular one you might be interested in as a site owner, SEO analyst, webmasters.
Its fantastic tool and you can use in multiple ways.
That’s right – so many ways. If you are a developer, you can use it with Node.js to run a test programmatically. There are already few tools in the market powered by Lighthouse who offer continuous site performance monitoring.
Let’s find out how you run lighthouse test against your site.
Start from the easiest one.
Google released web.dev a few months back and gained good popularity. Testing online is easy.
Go to Measure page and enter the URL to run the audit. It will take a few seconds, and you should see the detailed reporting with the overall scoring.
Results also show the success metrics test so well done for the passed audits and work on those needs attention.
Don’t spend too much time getting 100. Even Google’s sites don’t score that.
Consider them as guidelines and try to improve as much you can.
Note: web.dev emulate a test using a Mobile device, and while writing, I don’t see an option to test using Desktop.
Do you know Lighthouse is available in your Chrome browser? And, the great news is, you can choose to test using Mobile or Desktop. It’s available in Developer tools.
As you can see above, you have an option to choose what you want to test. This is great as you can focus on your goal and get the audit results faster.
Results look and feel from Chome and web.dev is almost similar.
But if you look at carefully, there is one extra metrics group here – Progressive Web App. So another reason to audit using Chrome.
Lighthouse is available as a Node module. You can get it installed on your server and use it programmatically or command line. Let’s quickly check out how to install Lighthouse to run some test.
You will also require chromium browser to be installed on the server. I covered the installation instruction here.
Installing Lighthouse is straightforward, as you do other modules.
npm install -g lighthouse
I am using
-g here so it get installed as global module.
root@geekflarelab:~# npm install -g lighthouse /usr/bin/lighthouse -> /usr/lib/node_modules/lighthouse/lighthouse-cli/index.js /usr/bin/chrome-debug -> /usr/lib/node_modules/lighthouse/lighthouse-core/scripts/manual-chrome-launcher.js > firstname.lastname@example.org postinstall /usr/lib/node_modules/lighthouse/node_modules/axe-core > node build/utils/postinstall.js + email@example.com added 179 packages from 119 contributors in 10.094s root@geekflarelab:~#
Once installed, run
lighthouse command to ensure it has installed correctly.
root@geekflarelab:~# lighthouse Please provide a url Specify --help for available options root@geekflarelab:~#
Good, lighthouse is ready to run the audit. Let’s try some test options.
To run a test using a headless browser
lighthouse URL --chrome-flags="--headless"
You need to provide an absolute URL including http or https.
In the second last line, you can see it has printed the path where I can find the report. By default, it will generate a report in HTML format which you can view either by downloading on your PC or serve it through some web server.
But, what if you have to generate a report in JSON format?
It’s doable as the following.
lighthouse URL --chrome-flags="--headless" --output json --output-path URL.json
By using Lighthouse CLI, you are in full control to use the way you want it. I would strongly recommend to check out the GitHub repository to learn more about using CLI or programmatically.
Google Lighthouse looks promising tool to perform a continuity test to improve site performance and usability. If you are using WordPress and looking to make your site loads faster then check out Rocket.
Delivering customer satisfaction in a SaaS business is priority 1,2 and 3, at least that’s…
We all deal with push notifications on a daily basis. Apps and websites use them…
Emails are an inherent part of your company’s business process, whether you want to interact…
There comes a time in every successful business when you have to upgrade your resources,…
The e-commerce landscape has been dramatically boosted in recent times by advances in Internet technologies…