How to Use Google Lighthouse for Performance Audits

· Category: Web Performance

Short answer

Google Lighthouse is an open-source tool that audits web pages for performance, accessibility, SEO, and best practices. It can run in Chrome DevTools or from the command line.

Steps

  1. Open Chrome DevTools and navigate to the Lighthouse tab.
  2. Choose the categories and device type to simulate.
  3. Click "Analyze page load" and wait for the report.
  4. Review the scores and prioritized improvement suggestions.
  5. Run Lighthouse in CI with the Node CLI for regression testing.

Tips

  • Use the Lighthouse CI GitHub Action to enforce budgets on pull requests.
  • Run multiple audits and average the scores for consistency.
  • Focus on the metric diagnostics rather than the overall score alone.

Common issues

  • Extensions and cached data skew lab results; use Incognito mode.
  • Different machines produce different scores due to CPU throttling differences.