Before the garden site goes online, you run Lighthouse on it with all four categories, and sort every finding it reports: fix it, or explain why you’re leaving it.
Key Points
- Run all four categories. Open the page in Chrome, open DevTools, and pick the Lighthouse panel. Leave Performance, Accessibility, Best Practices and SEO ticked, keep the device on Mobile, and click Analyze page load. Lighthouse reloads the page and writes a report. The garden’s home page scores 100 in all four.
- An accessibility 100 means every check Lighthouse scores has passed, not that every visitor can use the page. The report still lists ten items to check by hand.
- Performance is one estimated load. Its score weighs five timings from one load instead of counting passed checks. The report’s footer says how it loaded the page: a single page session, on an emulated Moto G Power with slow 4G. Under the score, the report says “Values are estimated and may vary.” A real phone on a real network can be slower.
- SEO checks that a description exists. The audit called Document has a meta description passes because the head has one. It can’t tell whether that description would make anyone click. A description that says only “Home page” passes too. Judging it is your job.
- A 100 doesn’t mean an empty report. Under Performance, Lighthouse lists insights, some with an estimated saving. They don’t lower the score. For each one, decide: fix it, or explain, in a note to yourself, why you’re leaving it. On the home page:
- Use efficient cache lifetimes is about how long a browser may reuse a file, and the compression line in Document request latency is about squeezing text before it’s sent. The server sets both, so your HTML can’t change them. Explain them as the host’s job, and recheck once the site is online.
- Render-blocking requests names
style.css. The page needs it to draw, and it’s one small file. Explain. - Two insights show no estimate. LCP request discovery, the insight about finding the main photo, wants it marked high priority, but it’s in the HTML and not lazy-loaded, so the browser finds it early. Network dependency tree has only the page and one stylesheet. Explain both. If the photo shows up late on a real phone, mark it then.
- Improve image delivery says plot 7’s photo is 800 pixels wide. It takes 380 CSS pixels on the screen, and this phone packs 1.75 screen pixels into each, so it needs 665 image pixels. The
srcsetoffers no size in between, so the browser took the next one up. Explain. - The same insight’s two compression rows suggest stronger compression: 32.4 KiB on plot 7’s photo and 11.9 KiB on the tool shed’s JPEG. They’re small savings on a small site, so explain them.
- The seed swap page has real fixes. It scores 98 for Performance, 96 for Best Practices and 91 for SEO:
- Its photo is 1200 pixels wide, for a space that needs 665, and its
<img>has nosrcset. There’s no smaller file for the browser to choose, so a phone downloads about 190 KiB more than it needs. Fix. - SEO reports no meta description. Best Practices logged a console error: the page has no icon link, so the browser asked for the default
/favicon.icoand got a 404. Lighthouse reports the error, not the icon itself. Both are fixes in the page’s head. - The project has you fix or explain every finding on every page.
- The rule: a Lighthouse score sums up one load: timings for Performance, automated checks for the rest. Sort every finding: fix it, or explain why you’re leaving it. Then check what Lighthouse can’t: use the page with only the keyboard and with a screen reader, read your descriptions and alt text, and try a real phone once the site is online.
Final Code
No code changes in this lesson. The seed swap page’s photo, the one Lighthouse sorts as a fix, as it stands in events/seed-swap.html: