How to test lazy-loaded images on a website
Lazy loading delays images that a visitor does not yet need. On a long event gallery or programme page, that can reduce initial image transfers. But a blanket lazy setting can also delay the main image or leave lower images blank during a fast scroll. Use this release check to compare what the browser actually requests with what visitors see.
Boletolibre editorial team
Published
Map the images before changing a setting
Choose a representative page with enough media to matter: an event recap, photo archive, exhibitor gallery or speaker list. Mark the first visible image, an image near the bottom edge of a phone screen, and several far below it. Include a carousel or hidden panel only if the actual page uses one. Record the URL, viewport, browser, connection and current build so the same page can be retested.
The goal is not to delay every image. It is to avoid fetching media no visitor has reached while preserving the page’s useful first view. Compare a cold visit and a repeat visit separately: a cached image can make a broken lazy-loading test look successful. Keep poster file size and crop work in the separate image-optimization guide; this check concerns request timing and visible results.
Make the baseline falsifiable before touching the page: choose the exact images by URL or a stable element name, and define what “initial” means for this run. Record a top-of-page screenshot, scroll position zero, viewport dimensions, zoom level and whether the browser already has a service worker controlling the page. If the page has a mobile and desktop layout, inventory both; a picture that is below the fold on a laptop may become the first large image on a phone. This avoids comparing two different sets of visible media as if they were one test.[5]
| Image position or role | Loading decision to review | What the test must show |
|---|---|---|
| First-viewport hero or poster | Normal loading; inspect LCP candidate | Request starts without a scroll trigger |
| Near the first fold | Decide from real phone and network | Image is ready when reached |
| Lower gallery or recap image | Candidate for lazy loading | Initial transfer deferred; scroll still works |
| Ticket or access QR image | Treat as task-critical when visible | No blank critical instruction |
Keep important first-viewport images on the normal path
An image visible when the page opens, especially one likely to be the Largest Contentful Paint (LCP) image, should not be marked `loading="lazy"`. Google’s performance guidance explains that lazy-loading an LCP image creates an avoidable request delay. Keep date, venue and ticket action readable without waiting for a lower-page gallery. If a CMS or theme applies lazy loading to every image automatically, ask the site owner to inspect the published HTML, not only the editor preview.[1][4]
A near-the-fold image needs a real phone check. Browsers choose their own distance from the viewport at which to start a lazy request; it is not a fixed rule such as “load only when visible.” Test the widths and connection types your visitors use. The image may begin loading before it enters view, and that can be the right behavior if it appears without a blank gap.[1]
Use a load trace to identify the actual LCP element instead of assuming the largest-looking poster is the candidate. If an image is the LCP element, compare its discovery time, request start, transfer and render delay before and after the change. A late request suggests the browser encountered the URL late or was told to defer it; a fast request followed by slow painting points elsewhere. An LCP number from one local run is diagnostic, not proof that visitors improved. Keep the image role and the measured element together in the log.[4][6]
Check the markup and reserve image space
For ordinary HTML images, the developer can use `loading="lazy"` on offscreen `<img>` elements, including the fallback `<img>` within `<picture>`. Keep a real `src`, meaningful `alt` text where appropriate and `width`/`height` or a stable aspect ratio. The browser needs reserved space to avoid a page jump as the file arrives. An image with no dimensions may even appear to fit in the initial viewport, so everything loads at once.[1][2]
Verify the published output. Page builders and image components may rewrite `src`, `srcset`, `sizes` or loading attributes; a source file alone is not proof. The responsive candidate selected on a phone can differ from desktop. A CSS background image does not use the HTML `loading` attribute. Custom JavaScript loading needs its own fallback and rendered-source check rather than an assumption that the native attribute controls it.[1]
Inspect the image element in the delivered page at each viewport, then match its selected resource to a Network request. The `src` attribute can name a fallback while `srcset`, `sizes` or `<picture>` selects another file; test the URL actually fetched, not just the URL written in the template. Check that the reserved box matches the intended aspect ratio before and after decoding. If the site uses custom JavaScript, verify what happens when its loader does not run; native browser lazy loading does not require an application loader and will fetch eagerly when scripting is disabled.[1][2]
Run a clean initial-load observation
Open the browser Network panel before loading the page. Disable cache for this cold run, filter to images, then reload. Note the hero request, far-below images, start times and transferred bytes. The visible image should not wait for scrolling; not every far-below image should be fetched immediately. Do not fail the page because an image starts before it crosses the screen edge: browsers intentionally fetch ahead of visibility.[1]
Also watch the page, not just the request list. A successful response can still decode or paint too late to help the visitor. The `window.load` event is not a reliable completion signal for lazy images; MDN notes that even a lazy image in the visible viewport may still be pending when it fires. Use a specific image’s request and rendered state for the decision.[2]
For a comparable first pass, open DevTools before reloading, clear the existing request log, select a fixed network profile and disable cache while DevTools remains open. Keep the page at its initial scroll position until the early requests settle. For each chosen image, note whether a request exists, its initiator, start time, status and transferred size. The “Img” filter helps isolate image requests, but check an unfiltered view if an image is fetched through a script or an unexpected resource type. Record the profile name and browser version; do not compare a throttled phone run with an unthrottled desktop run.[5]
Interpret an eager-looking lower image before changing code. It may sit inside the browser’s look-ahead distance, be preloaded by the page, have no reserved height, or be a cache or service-worker response rather than a new transfer. Measure its distance from the viewport in the tested layout and inspect the request initiator. Try a farther image before declaring lazy loading broken. Conversely, the absence of an initial request is only half a pass: it must later start and paint when the visitor approaches. A blank slot with no request is a failure even though the initial byte count looks excellent.[1][5]
Scroll under a constrained connection
Apply a repeatable slower network profile, reload cold, and scroll toward each target in normal and faster steps. Record when the request begins and whether the image is actually visible by the time the visitor reaches it. Check a narrow phone and a wider screen; repeat on a real device when possible. If an image appears late, identify whether the delay comes from request timing, transfer, decoding or a hidden container before changing any threshold.
Watch for layout movement as images appear. Correct intrinsic dimensions or aspect ratios before accepting the release. A gallery that saves transfer bytes but pushes the next heading or ticket link down while the visitor reads is a poor result. Compare the same page and network conditions before and after the change, including an ordinary repeat visit with cache enabled.[1]
Run the scroll check as a short sequence: stop near the first deferred image, note the request and visible result, continue to the middle of the page, then make one faster jump to a distant image. Repeat the same sequence after a cold reload. Define the user-facing pass condition before running: the image should be usable by the time it matters to the task, without a blank interval that obscures a speaker, venue map or ticket instruction. There is no universal millisecond or pixel threshold; record the observed gap and decide its importance for that page.
For example, suppose a test gallery has a visible hero, an image just below the first screen and six later photos. A request for the near image before scrolling can be acceptable if it appears instantly when reached. A far photo that is absent initially but remains blank after a fast jump needs investigation. If its request begins only after the jump, examine the trigger; if it starts earlier but finishes late, inspect bytes and transfer; if it finishes early yet stays blank, inspect decoding, visibility and rendering. This example is a diagnosis pattern, not a benchmark.
| Observation on an illustrative page | Interpretation | Next check |
|---|---|---|
| Hero request starts only after scrolling | Fails the first-view requirement | Inspect published loading attribute and URL discovery |
| Near-fold photo requests before it is visible | May be normal browser look-ahead | Check whether it paints when reached |
| Far gallery photo waits, then stays blank after a fast jump | Deferral worked; arrival did not | Compare trigger, transfer and paint timing |
| Gallery loads and the ticket action moves | Layout stability failed | Check intrinsic dimensions and container size |
Inspect search visibility and unusual states
Test the cases the page actually contains: rapid scrolling, responsive image sources, hidden carousel slides, tabs, a failed image request and browser back navigation. A placeholder must turn into the real image or a clear failure state; it must not stay blank forever. Keep useful alternative text for informational images. A decorative image can have an empty `alt`, regardless of when it loads.
If search discovery matters, inspect the rendered page with Google Search Console’s URL Inspection tool. Google says lazy content should load when visible without requiring clicks or scroll actions from its crawler, and image URLs should appear in rendered image `src` attributes. A script that leaves the real URL only in a custom data attribute can hide the image from discovery. Do not claim a screenshot alone proves this.[3]
Treat unusual states as separate observations rather than squeezing them into the normal scroll result. Open a hidden carousel slide or tab, retry after an image error, navigate away and back, and test the responsive source chosen at a second width. For a custom observer, a nested scrolling container or an image inserted after page load can have a different trigger path; inspect whether a real `src` is eventually assigned. If search matters, compare the user-visible result with Search Console’s rendered HTML. A visible browser image and a crawler-visible URL are related checks, not interchangeable evidence.[3][7]
| Symptom | Evidence to collect | Likely next action |
|---|---|---|
| All gallery files start immediately | Viewport distance, image dimensions, request initiators | Check near-fold heuristics, preload and missing layout space |
| Hero appears late | LCP element, `loading`, request start and paint time | Remove unintended lazy deferral; investigate other delay separately |
| Only phone image is missing | Rendered `<picture>`, `srcset`, selected request and status | Correct responsive source or media rule |
| Placeholder remains after fast scroll | Request status, observer trigger or hidden container | Fix trigger/fallback, then retest the actual scroll |
| Page jumps as photos arrive | Image and container dimensions before/after paint | Reserve the correct aspect ratio |
| Search rendering omits a photo | URL Inspection rendered `img src` | Expose the image URL without crawler interaction |
Record a measured release decision
Use the worksheet to log image class, viewport, initial request, scroll result, layout shift, rendered source and owner. Accept the change only if the first visible image remains prompt, lower images arrive in time, layout stays stable and the relevant content is discoverable. Keep a before/after record of request timing and transferred bytes; a single page-speed score cannot explain which image failed. Retest after changing the theme, CMS image component, gallery, hero or hosting behavior.
Approve by image role, not by a single aggregate score. A release can save initial bytes and still fail because the visible hero starts late, a critical map stays blank, or a gallery shifts the ticket button. Record the before/after request and appearance for the same conditions, classify each issue as blocking or follow-up, and name an owner. If results vary across runs, repeat the same controlled scenario and keep the range instead of selecting the best trace. Reopen this log when the CMS, theme, image component or gallery logic changes; those are the places that can silently reverse the behavior.
- Initial: visible image appears promptly and far-below images are not all requested.
- Scroll: each deferred image appears before or as it is needed, including after a rapid scroll.
- Stability: image space is reserved, with no disruptive movement on load.
- Discovery: rendered markup exposes intended image URLs without crawler interaction.
Download the lazy-image release check and observation log (Markdown, English)
Sources and further reading
- Browser-level image lazy loading for the webGoogle web.dev · Accessed
- HTML img element: loading and dimensionsMDN Web Docs · Accessed
- Fix lazy-loaded contentGoogle Search Central · Accessed
- Optimize Largest Contentful PaintGoogle web.dev · Accessed
- Network features referenceChrome for Developers · Accessed
- Performance features referenceChrome for Developers · Accessed
- Intersection Observer APIMDN Web Docs · Accessed