{"id":170,"date":"2019-12-23T02:46:29","date_gmt":"2019-12-23T02:46:29","guid":{"rendered":"http:\/\/elementor.jimfahad.com\/elementor129\/2019\/12\/23\/page-speed-tools-a-developers-review-of-google-lighthouse\/"},"modified":"2020-04-13T05:40:51","modified_gmt":"2020-04-13T05:40:51","slug":"page-speed-tools-a-developers-review-of-google-lighthouse","status":"publish","type":"post","link":"https:\/\/elementor.jimfahad.com\/elementor129\/2019\/12\/23\/page-speed-tools-a-developers-review-of-google-lighthouse\/","title":{"rendered":"Page Speed Tools: A Developer\u2019s Review of Google Lighthouse"},"content":{"rendered":"<p>As web developers, we have an array of tools available to measure the performance of the sites we build. Tools like&nbsp;<a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\/\" target=\"_blank\" rel=\"noopener noreferrer\">PageSpeed Insights<\/a>,&nbsp;<a href=\"http:\/\/yslow.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">YSlow<\/a>, and&nbsp;<a href=\"https:\/\/tools.pingdom.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Pingdom<\/a> have been our go-tos for years \u2014 yet something has never been quite right. How many times have you seen a site with poor metrics load in what seems like a split-second while sites that play by every single rule can be the opposite? The answer lies in that none of the tools above measure: perception. That\u2019s where&nbsp;<a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse\/\" target=\"_blank\" rel=\"noopener noreferrer\">Lighthouse<\/a>&nbsp;comes in.<\/p>\n<h3>What is Lighthouse and why is it different?<\/h3>\n<p>Lighthouse is a new set of tools that shed a different type of light onto various aspects of a site, with one of those items being performance. Instead of using a rigid set of assumed best practices and seeing which boxes your site marks off, running a performance test in Lighthouse invokes a process that is more akin to the users&#8217; perception of how quickly content is loading.<\/p>\n<p>While we often spend our days developing on powerful machines and high-bandwidth connections, we can begin to forget how important it is to make sure our sites are performing well on phones and tablets. These devices lack the same processing power and maybe on connections with less available bandwidth. When running a test within Lighthouse, the CPU and network connection are throttled which helps remind us how important it is to optimize our sites for all devices.<\/p>\n<p>In addition to performance metrics, Lighthouse also includes tests for&nbsp;<a href=\"https:\/\/developers.google.com\/web\/ilt\/pwa\/lighthouse-pwa-analysis-tool\" target=\"_blank\" rel=\"noopener noreferrer\">Progressive Web Apps<\/a>, Best Practices, and Accessibility. These are items that are often not covered by other tools yet play an important role in both user experience and SEO.<\/p>\n<h3>How to run Lighthouse<\/h3>\n<p>As of Chrome version 60, Lighthouse is built into the \u201caudits\u201d panel within the&nbsp;<a href=\"https:\/\/developers.google.com\/web\/tools\/chrome-devtools\/\" target=\"_blank\" rel=\"noopener noreferrer\">developer tools<\/a>. Since Lighthouse does not require an external server to run, it\u2019s possible to perform tests in local development environments. This greatly speeds up the process of making performance changes as deploying to a publicly accessible server is no longer necessary.<\/p>\n<p>Additionally, Lighthouse can be installed as&nbsp;<a href=\"https:\/\/www.npmjs.com\/package\/lighthouse\" target=\"_blank\" rel=\"noopener noreferrer\">an NPM package<\/a>&nbsp;and run from either the command line or as part of any build process based on Node.js.<\/p>\n<h3>How to interpret the performance metrics<img fetchpriority=\"high\" decoding=\"async\" class=\"alignright wp-image-17827\" src=\"https:\/\/uploads.gravitatedesign.com\/2017\/08\/25164121\/Lighthouse-example-resized-300x288.jpg\" sizes=\"(max-width: 440px) 100vw, 440px\" srcset=\"https:\/\/uploads.gravitatedesign.com\/2017\/08\/25164121\/Lighthouse-example-resized-300x288.jpg 300w, https:\/\/uploads.gravitatedesign.com\/2017\/08\/25164121\/Lighthouse-example-resized-768x738.jpg 768w, https:\/\/uploads.gravitatedesign.com\/2017\/08\/25164121\/Lighthouse-example-resized.jpg 850w\" alt=\"Pagespeed Google lighthouse screencapture\" width=\"440\" height=\"422\"><\/h3>\n<p>Since Lighthouse bases its metrics on user experience, it puts a high priority on anything that can help get content to the user faster. One of the most important things you can do for your site is reduce the time needed for the&nbsp;<a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse\/audits\/first-meaningful-paint\" target=\"_blank\" rel=\"noopener noreferrer\">first meaningful paint<\/a>. The first meaningful paint occurs after the HTML markup has been parsed and all critical styles have been loaded, allowing the browser to perform its initial rendering of the page. We can reduce the amount of time before this event occurs by deferring any CSS and JavaScript that is not initially needed. The goal is to load additional assets while the user is digesting the prioritized above-the-fold content.<\/p>\n<p>While slightly less critical than the first paint, the time it takes a browser to fully load a page is also important. Lighthouse has two metrics for this:&nbsp;<a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse\/audits\/first-interactive\" target=\"_blank\" rel=\"noopener noreferrer\">First Interactive<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse\/audits\/consistently-interactive\" target=\"_blank\" rel=\"noopener noreferrer\">Consistently Interactive<\/a>. On devices with less CPU power, the site can potentially feel sluggish to users since the browser is still loading assets while they\u2019ve begun to interact with it. Again, the goal here is to optimize what the browser needs to load and oftentimes the culprit is images. By ensuring that images are properly sized for different types of devices and waiting to load images until they are nearly visible we can reduce the number of assets required for the page to be completely loaded.<\/p>\n<p><a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse\/audits\/speed-index\" target=\"_blank\" rel=\"noopener noreferrer\">Perceptual Speed Index<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse\/audits\/estimated-input-latency\" target=\"_blank\" rel=\"noopener noreferrer\">Estimated Input Latency<\/a> are audit scores that you should also pay attention to. The Perceptual Speed Index measures exactly what you think it does and is closely tied to the first meaningful paint metric. Estimated Input Latency measures the responsiveness of your site and tries to enforce a 60 frames-per-second user experience. I\u2019ve found that negative impacts on this score are usually related to JavaScript which is not performing well.<\/p>\n<p>The Opportunities section is a great overview of what you can do to help speed up your site and should be seen as a to-do list. There is a heavy emphasis on deferring non-essential JavaScript, CSS, and images in addition to ensuring that your images are properly sized for different devices. These are the items that can have a significant benefit to your first meaningful paint time.<\/p>\n<p>Finally, the Diagnostics section is small but contains a very useful item called the <a href=\"https:\/\/developers.google.com\/web\/tools\/lighthouse\/audits\/estimated-input-latency\" target=\"_blank\" rel=\"noopener noreferrer\">Critical Request Chains<\/a>. The Critical Requests Chains item shows you exactly what resources are needed in order to start the first meaningful paint along with their respective sizes. By taking steps to reduce the chain length and also reducing the amount of data that is loaded, your first meaningful paint time will improve.<\/p>\n<h3>Is Lighthouse the new standard in performance metrics?<\/h3>\n<p>While we haven\u2019t read anything specifically denoting Lighthouse as the new standard in performance metrics, its emphasis on user experience is something that should make it one of your frequently used tools. Over the past few years, Google has put an increasing emphasis on mobile performance, and adjusting your site to reach the highest score possible in Lighthouse will certainly not harm your rankings.<\/p>\n<p>We find that Lighthouse has more merit in its recommendations than other tools do. It doesn\u2019t fixate on elements that we can\u2019t control such as expires headers and redirects on external scripts. Instead, it supplies me with actionable items that end up having a significant impact on site performance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As web developers, we have an array of tools available to measure the performance of the sites we build. Tools like&nbsp;PageSpeed Insights,&nbsp;YSlow, and&nbsp;Pingdom have been our go-tos for years \u2014 yet something has never been quite right. How many times have you seen a site with poor metrics load in what seems like a split-second &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/elementor.jimfahad.com\/elementor129\/2019\/12\/23\/page-speed-tools-a-developers-review-of-google-lighthouse\/\"> <span class=\"screen-reader-text\">Page Speed Tools: A Developer\u2019s Review of Google Lighthouse<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":46,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-170","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website-basic"],"_links":{"self":[{"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/posts\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":1,"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":245,"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/posts\/170\/revisions\/245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/media\/46"}],"wp:attachment":[{"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elementor.jimfahad.com\/elementor129\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}