Sub topic 10
Keep the Page Fast with Optimized Media
This chapter assumes you have a landing page with a hero section and a lead form, and that you can add images and sections in a drag-and-drop builder. You do not need to write code. A few optional snippets appear for builders that allow custom HTML.
By the end you will be able to choose image formats and sizes, set up lazy loading, handle video and fonts, and measure whether the page is fast enough to protect your conversion rate.
Why speed matters for a campaign page
Visitors from an ad or an email arrive with little patience. If the page takes several seconds to show its headline and button, some of them leave before they see the offer. You have already paid for those visits, so slow loading wastes campaign budget.
Media is usually the largest part of a landing page. A single uncompressed photo from a phone can be 4 to 8 MB, which is more than the rest of the page combined. Fixing media is the cheapest speed improvement you can make.
The metrics to know
Google's Core Web Vitals are the common yardsticks. You will see them in PageSpeed Insights and in Lighthouse in Chrome.
| Metric | What it measures | Good target | Typical media cause |
|---|---|---|---|
| Largest Contentful Paint (LCP) | Time until the largest visible element (often the hero image) is drawn | 2.5 seconds or less | Oversized or late-loading hero image |
| Cumulative Layout Shift (CLS) | How much content jumps around while loading | 0.1 or less | Images with no reserved space, late-loading fonts |
| Interaction to Next Paint (INP) | How quickly the page responds to taps and clicks | 200 ms or less | Heavy scripts, autoplaying video widgets |
For a landing page, LCP is the one to watch first. The hero image or hero video poster is almost always the LCP element.
Choose the right image format
Different formats suit different content.
| Format | Best for | Notes |
|---|---|---|
| JPEG | Photos | Small files at medium quality. No transparency. |
| PNG | Screenshots, graphics needing transparency | Large for photos. Use sparingly. |
| WebP | Photos and graphics | Usually 25 to 35 percent smaller than JPEG. Supported in all current major browsers. |
| AVIF | Photos | Often smaller than WebP. Slower to encode, and some builders do not accept it. |
| SVG | Logos, icons, simple illustrations | Scales to any size and is tiny. Not for photos. |
A practical rule: use SVG for logos and icons, WebP or JPEG for photos, and PNG only when you need transparency that SVG cannot give you. Many builders convert uploads to WebP automatically. Check your builder's media settings before converting by hand.
Size images for where they appear
Two separate things make an image heavy: its pixel dimensions and its compression level. Fix both.
Match pixel dimensions to display size
A hero image shown at 1200 pixels wide on a desktop does not need to be 4000 pixels wide. As a rule of thumb, export at about 2 times the largest display width, to keep it sharp on high-density screens. For a 1200 px slot, that means 2400 px at most. For a small feature icon displayed at 80 px, 160 px is plenty.
Compress
For photos, a quality setting of 70 to 80 percent is usually visually indistinguishable from 100 percent and cuts the file size a lot. Free tools such as Squoosh, TinyPNG, or your builder's built-in optimizer can do this. Compare the before and after at full size before you accept the result.
Set a budget
Pick numbers before you start so you can tell when you are done. A reasonable budget for a simple campaign page:
- Hero image: under 200 KB.
- Each supporting image: under 100 KB.
- Total page weight: under 1.5 MB, excluding video.
These are guidelines, not rules. A photography business will accept larger files than a software signup page.
Responsive images
A phone does not need the desktop file. Modern builders generate several sizes of each upload and let the browser choose with the srcset attribute. If your builder does this, you gain speed without extra work. If it lets you add custom HTML, you can do it yourself:
<img
src="hero-800.webp"
srcset="hero-480.webp 480w, hero-800.webp 800w, hero-1200.webp 1200w"
sizes="(max-width: 600px) 100vw, 1200px"
width="1200"
height="675"
alt="A team reviewing a campaign dashboard on a laptop"
>The srcset list gives the browser the available files and their widths. The sizes attribute tells it how wide the image will be at each screen width, so it picks the smallest adequate file. The width and height attributes are covered in the layout shift section below.
Art direction
Sometimes a wide hero crop looks poor on a narrow phone, because the subject becomes tiny. Some builders let you upload a separate mobile image or set a different focal point for mobile. Use that option when it exists, and keep the mobile file small.
Load images in the right order
Not every image should load at the same time.
Lazy loading for images below the fold
Lazy loading delays an image until the visitor scrolls near it. This cuts the initial download. Most builders enable it by default. In plain HTML it is one attribute:
<img src="testimonial-1.webp" width="400" height="400" loading="lazy" alt="Portrait of Dana Lee, operations manager">Never lazy load the hero
The hero image is visible immediately. Lazy loading it delays the LCP, which is the opposite of what you want. Check your builder for a setting such as "load eagerly" or "priority" on the hero image. In custom HTML, leave out loading="lazy" on the hero and add fetchpriority="high":
<img src="hero-1200.webp" width="1200" height="675" fetchpriority="high" alt="A team reviewing a campaign dashboard on a laptop"><br>
Prevent layout shift
If the browser does not know an image's size before it loads, the text below jumps down when the image arrives. A visitor may tap the wrong button as a result, including a form submit.
To prevent it:
- Give every image a fixed width and height or an aspect ratio. In the
<img>tag,widthandheightattributes let the browser reserve space. - In a builder, set the image container to a fixed aspect ratio such as 16:9 instead of "auto".
- Do not insert banners or cookie notices above existing content after the page loads. Overlay them or reserve their space.
Handle video carefully
Video is the heaviest media type, and an autoplaying background video is a common cause of slow landing pages.
- Prefer a still image in the hero. Use video only if it clearly improves the offer.
- If you use video, host it on a video platform or your builder's video hosting, not as a raw file in the page.
- For embedded players (YouTube, Vimeo), use a click-to-play thumbnail. A default embed downloads several hundred KB of scripts even if nobody presses play.
- For a background loop, keep it under about 5 seconds, muted, without audio track, compressed to under 2 MB, and provide a poster image so something shows immediately.
- Never make video the only way to understand the offer. Mobile data saver modes may block autoplay.
Fonts and icons
Fonts are media too. Each font file is a download, and a late font causes text to flash or shift.
- Use at most two font families and two or three weights.
- Prefer your builder's built-in or system fonts when brand rules allow.
- If you use a web font, serve it in WOFF2 format and keep
font-display: swapso text appears right away in a fallback font. - Use SVG icons or an icon set that loads only the icons you use, rather than a full icon font with hundreds of unused glyphs.
Trim what else loads
Images are not the only cause of weight. Review:
- Third-party scripts such as chat widgets, heatmaps, and multiple tracking pixels. Each one adds downloads and can hurt INP. Keep only those that serve your campaign goal.
- Unused sections left over from the template. Delete hidden sections, because hidden content still downloads in many builders.
- Animations that run on load. Reduce them or remove them above the fold.
Measure and improve
Work in a loop so you know what helped.
- Publish the page, or use the builder's preview URL if it is public.
- Run PageSpeed Insights on the URL and record the mobile LCP, CLS, and total page weight.
- Open the diagnostics list and note the top two items, such as "Properly size images" or "Defer offscreen images".
- Fix the largest one, republish, and measure again.
Read lab data and field data correctly
PageSpeed Insights shows two kinds of results. Lab data comes from a simulated test run once on a throttled mobile connection, and scores vary from run to run. Field data comes from real Chrome users over the previous 28 days. A new page with little traffic has no field data, so rely on lab data and run it two or three times. Treat the score as a guide, and weigh LCP and CLS more than the single 0 to 100 number.
Common errors
- Uploading originals. A full-size camera file dropped into the hero. Export and compress first.
- Lazy loading the hero. Delays the main visual. Load it eagerly.
- Compressing too far. Visible blocks or smeared text in an image. Raise quality or switch format.
- Text baked into images. The text is not selectable, does not scale, is invisible to screen readers, and often forces a larger file. Keep headlines and button labels as real text.
- Testing only on office Wi-Fi. Use the mobile result in PageSpeed Insights or throttle the connection in browser developer tools.
- Forgetting alt text during optimization. Renaming or re-uploading an image can drop its alt text. Recheck after replacing files.
Quick checklist
- Logos and icons are SVG, photos are WebP or JPEG.
- Hero is under 200 KB and loads eagerly.
- Images below the fold load lazily.
- Every image has reserved space.
- No autoplaying heavy video.
- Two font families or fewer.
- Mobile LCP is at or below 2.5 seconds and CLS at or below 0.1.
Exercise
Your hero image is a 5 MB JPEG, 4800 px wide, shown in a 1200 px wide slot, and your builder has lazy loading turned on for all images. PageSpeed Insights reports a mobile LCP of 5.1 seconds. List the changes you would make, in order, and explain why each one helps.
Show answer
1) Resize the image to about 2400 px wide at most, because the browser does not need 4800 px for a 1200 px slot and the extra pixels only add download time. 2) Compress it to roughly 75 percent quality and export as WebP (or JPEG if WebP is unavailable) to reach a file under 200 KB. 3) Turn off lazy loading for the hero image, or set it to load eagerly or with high priority, because lazy loading delays the largest visible element and so delays LCP. 4) Reserve space with a fixed aspect ratio, such as 16:9, to prevent layout shift. 5) Republish and rerun PageSpeed Insights, comparing the mobile LCP with the 2.5 second target.
Exercise
A teammate wants a 20 second autoplaying background video with the headline and button text embedded in the video. Give two performance problems and one other problem with this plan, and suggest an alternative.
Show answer
Performance problems: the video file will be large and compete with the rest of the page for bandwidth, which delays LCP, and an autoplaying loop adds processing work that can hurt responsiveness. Other problem: the headline and button inside the video are not real text, so screen readers cannot read them, they cannot be translated or indexed, and the call to action is unusable if autoplay is blocked or the video fails to load. Alternative: use a compressed still hero image with real text for the headline and button, or a muted loop of 5 seconds or less under 2 MB with a poster image and the text kept as live page content.