Lighthouse
Lighthouse is the most-used and most-misread performance tool on static sites. A score is a simulation of one specific reader on one run, and the guides below treat it that way: as a regression gate with budgets per template, run several times and summarised by the median, with throttling calibrated against what real readers experience rather than the default profile.
Several of the guides exist because Lighthouse disagreed with itself or with the field — scores that moved by double digits between identical runs, layout shifts from banners and embeds that a single lab load never triggered — and show how to find out which number to believe.
Choosing the Right Static Site Generator for Production
- Fixing Low Color Contrast Flagged by LighthouseFixTrace Lighthouse and axe contrast failures on a static site back to a few design tokens, pick compliant replacements and keep them passing in both themes.
Core Web Vitals Optimization for SSGs
- Comparing Lab and Field Data with CrUXComparisonPull Chrome UX Report data for your origin and key URLs, line it up against Lighthouse lab numbers per template, and use the gap to set better budgets.
- Lighthouse CI vs WebPageTest for Regression GatesComparisonLighthouse CI and WebPageTest compared as pull request performance gates on a static site: variance, regressions caught, false alarms, speed and cost.
- Auditing Third-Party Scripts With LighthouseHow-toUse the third-party summary, the treemap and a long-task trace to attribute every kilobyte and millisecond to a vendor — then gate the total in CI so it cannot creep back.
- How to Reduce Bundle Size in Eleventy BuildsHow-toCut JavaScript in Eleventy builds — scope scripts per route, tree-shake and bundle with esbuild, and defer third-party code. Concrete before/after KB numbers.
- Measuring Third-Party Cost with Request BlockingHow-toQuantify what each third-party script costs a static site by blocking it in Lighthouse and WebPageTest, then compare LCP, TBT and bytes with and without it.
- Measuring Web Vitals in Playwright TestsHow-toMeasure LCP, CLS and interaction latency inside existing Playwright tests on a static site, with throttling, stable thresholds and per-PR results.
- Optimizing LCP on Astro with Priority HintsHow-toUse fetchpriority="high", rel=preload, and Astro Image priority to load the hero first and cut LCP — with measured before/after numbers from Lighthouse and WebPageTest.
- Per-Template Performance BudgetsHow-toSet a performance budget for each page template of a static site, pick representative URLs automatically, and enforce them with Lighthouse CI and size checks.
- Performance Testing on Throttled Mobile ProfilesHow-toChoose throttling that matches your real readers, calibrate Lighthouse and WebPageTest against field data, and test static sites on real mid-range phones.
- Running WebPageTest Scripts Against Preview DeploysHow-toScript multi-step WebPageTest journeys — search, navigation, repeat views — against every preview deploy, from locations Lighthouse cannot emulate.
- Setting Up Lighthouse CI for a Static SiteHow-toWire Lighthouse CI into GitHub Actions against every preview deploy: URL selection, assertions, a required status check and stored reports, in about an hour.
- Writing a Performance Budget That Fails BuildsHow-toDerive byte, request and timing limits from your own site, encode them per template in budget.json and CI, and ratchet them down without constant false alarms.
- Eliminating Render-Blocking CSS on Static SitesFixInline critical CSS, defer the rest, and purge unused rules to cut render delay on static sites — with measured LCP and FCP before/after from Lighthouse.
- Reducing Lighthouse Score Variance in CIFixWhy Lighthouse numbers jump between identical CI runs, and the six changes that shrank LCP spread from 800 ms to 90 ms so timing budgets can safely fail builds.
Often used with Lighthouse
- Astro2 shared guidesIslands, content collections, astro:assets and deployment.
- Eleventy1 shared guidesIncremental builds, image pipelines and the data cascade.
- GitHub Actions1 shared guidesCaching, matrix builds, reusable workflows and pinning.
- Playwright1 shared guidesEnd-to-end and visual regression tests on built output.