How we automated performance testing using Google PageSpeed Insights
One of the biggest challenges in running a platform or any web app is maintaining performance with every update.
Manually testing performance after each change isn’t scalable — especially when you have many pages.
The solution
We built a Node.js automation script powered by Google’s PageSpeed Insights API.
Here’s what it does:
- Iterates through all important pages (Home, Programs, Courses, Blog, etc.).
- Requests performance reports from PageSpeed Insights.
- Collects scores for the key categories:
- Performance
- Accessibility
- SEO
- Best Practices
- Saves the results into a JSON file for historical tracking.
We also added a retry mechanism: if an API request fails, it automatically retries up to 3 times before logging the page as failed.
Benefits
- Automated performance monitoring without manual effort.
- JSON storage makes it easy to compare results across deployments.
- Reduces the risk of unnoticed regressions in performance.
Conclusion
By combining Google PageSpeed Insights API with Node.js automation, we created a simple yet powerful performance testing workflow.
It ensures our platform remains fast, and compliant with web best practices over time.