How-to Guide

Lazy-Loading Images Below the Fold on a Practice Page Without Delaying the Top Picture

Short answer

Lazy loading tells the browser to fetch a picture only when the visitor scrolls near it. Add loading=lazy to photos lower on the page, but leave the top picture alone so it appears at once. Always keep width and height on each image so the page does not jump.

By Gio LaRocheUpdated 5 min read
Get my free auditor call (561) 291-2681

Why picture weight matters on a phone

A practice page with a team photo, an office gallery, a map and a row of badges can quietly weigh more than the rest of the page together. On a phone with a weak signal, the visitor waits while pictures they have not scrolled to are downloaded. Lazy loading delays those pictures until they are needed.

web.dev's article on browser-level lazy loading, which we read before writing, notes that images are the most requested kind of file on most sites, and that at the 90th percentile sites send over 5 megabytes of images. Browsers now handle lazy loading themselves through a single attribute, with no extra script or library required.

The one attribute

The attribute is called loading. Set to lazy, it asks the browser to hold the picture until the visitor scrolls within a calculated distance. Set to eager, it is the normal behavior, and the same as leaving the attribute off. The article lists support in Chrome, Edge, Firefox and Safari. In its Chrome tests on 4G, 97.5 percent of lazy-loaded images had fully loaded within 10 milliseconds of becoming visible, so the visitor rarely sees a gap.

PictureLazy or not
The top photo or banner that fills the first screenNot lazy. Load it normally so it appears at once
Team photos and the office gallery lower downLazy
The map and review widget at the bottomLazy, with a reserved box so nothing jumps
Small icons in the first screenNot lazy

The mistake that makes a page slower

The article cautions against lazy-loading images likely to be in view when the page loads, and names the largest one on the first screen in particular. Delaying it works against you, because that picture is often the main item Google measures for loading speed. Some themes and plugins add lazy loading to every picture automatically, including the top one, so check.

Priority for the top picture

If the top picture is slow, web.dev says to raise its priority rather than make it lazy. The article describes an attribute called fetchpriority that can be set to high on that one image. Ask your designer to apply it only to the first large picture.

A five-minute check

  1. 1Open the page in Chrome, right-click and choose Inspect, then open the Elements panel and search for img.
  2. 2Look at the first large picture on the screen. It should not have loading=lazy. If it does, ask your designer to remove it.
  3. 3Look at a picture lower down. It should have loading=lazy, along with width and height numbers.
  4. 4In the Network tab, filter to Img and reload with throttling set to a slow phone. Lower pictures should appear in the list only after you scroll.
  5. 5Run a Lighthouse mobile report before and after, and write down the loading score and the largest-picture time.

Keep the dimensions on every picture, lazy or not. Without them the page jumps as each picture arrives, which our guide on layout shift on a practice page explains. The article also says frames, such as an embedded map, can be lazy-loaded with the same attribute.

Before upload, shrink the files, as covered in our guide to resizing and compressing office and staff photos. Lazy loading is a second step, not a substitute for sending smaller pictures. Describe each picture too, as in the guide to image SEO and alt text. Words that a patient needs, such as a phone number or hours, belong in real text rather than inside a picture, as our guide to text baked into banner images explains.

Frequently asked questions

What does loading=lazy do?

It asks the browser to delay downloading a picture until the visitor scrolls near it, which saves data and speeds up the first screen.

Should the top photo be lazy?

No. web.dev says not to lazy-load images likely to be in view at load, especially the largest one on the first screen. Load it normally and, if needed, raise its priority.

Does lazy loading work without JavaScript?

The article says the loading attribute is handled by the browser, so images still load when JavaScript is off, though the delay only applies when JavaScript is on.

Will lazy loading hide images from Google?

Browser-level lazy loading is designed to load images as they come into view, so it should not. We still recommend viewing the live page in Search Console's inspection tool to confirm.

Can I lazy-load an embedded map?

Yes. The same attribute works on frames, so a map lower on the page can wait until the visitor scrolls to it. Reserve its space so the page does not jump.

Sources

Keep reading

Ready to Grow Your Practice?

Primara is now accepting new independent practices nationwide. Most new engagements begin within one week.

Send Us a Message

We respond within one business day.

* Required field

We'll call to confirm your consultation.

No spam, ever. HIPAA-aware agency. We respond within one business day. For urgent inquiries, call (561) 291-2681.

Founder-LedHIPAA-AwareServing Practices Nationwide