DM3: Site speed, Core Web Vitals and the technical audit

Lesson 4 of 5 · reading 15–25 minutes; practice and project time is on the module page

Images, fonts and mobile-first pages

🎯You'll be able to

Choose image formats and sizes, use lazy loading safely, keep fonts light, and check pages the way a mobile-first crawler sees them.

🏠The everyday picture

You wouldn't post a wall-sized poster to someone who only has a postcard frame. Send the size that fits.

📘What it really is

📝A worked example

Input: a product photo uploaded at 3000 × 2250 pixels, 2.4 MB, shown at 320 × 240 on the product page.

Steps:

  1. Export versions at 320, 640 and 960 pixels wide in WebP.
  2. Use srcset with those three files and sizes="(max-width: 600px) 90vw, 320px".
  3. Keep width="320" height="240" and don't lazy-load it, as it's the main image.

Expected output: phones download a file of tens of kilobytes instead of 2.4 MB, and the layout doesn't move. (Illustrative sizes: real savings depend on the photo.)

🌍Where it's used

📝Case scenario

A travel agency's home page used six weights of two fonts and a 4 MB hero photo. On a 4G phone it took over six seconds to show the headline. Switching to the system font and a 120 KB WebP hero brought it under two seconds in lab tests on the same throttled phone.

🖱️Try it

Save a large photo from your phone and check its file size. Resize it to 640 pixels wide and export it as WebP or a compressed JPEG. Success: the new file is at least five times smaller and still looks fine on a phone.

⚠️Common mistakes

🛠️For your project

MittiMart uses small SVG drawings, so its images are light; Project 3 asks for width and height on every one (test 7). Your capstone design notes can describe how real product photos would be handled.

✅Quick check

Should the main image at the top of a page be lazy-loaded?

Show the answer

No; that delays the Largest Contentful Paint. Lazy-load images further down.

Which version of a page do search engines mostly index?

Show the answer

The mobile version.

← PreviousPage weight, blocking scripts and third-party tags
ProLearners Assist