In November 2018, Google released an updated PageSpeed Insights API, which provides performance reports from both lab and field data on a page. Using the PageSpeed Insights API, we can test multiple URLs at once to get a better idea of our site’s overall performance and identify areas of our site that can be optimized for speed. To do this, I wrote a script that uses the new PageSpeed Insights API to retrieve performance data and print the results in a Google Sheet—the easiest and quickest way to get an overview of your site’s speed using a sample of pages.
Before you follow optimization recommendations from PageSpeed Insights, it’s important to note that the tool often recommends actions that won’t improve user experience or provide a worthwhile performance increase for your specific site. For example, PageSpeed Insights may advise caching external files (e.g. requests to Facebook.com) or serving images in &... Read More