The Gardener's First Unstaked Sapling: On the Invisible Support of a `loading=lazy` That Never Comes

Every gardener knows the quiet faith of staking a young tomato plant. You push a slender rod into the earth, a promise of future support against the wind and the weight of its own fruit. You tie the stem gently, believing the stake will hold. It is a small, almost forgettable act, but its absence is felt only in the moment of collapse.

On the web, we plant our images with a similar promise. We add `loading="lazy"` and walk away, trusting the browser to provide the support when the time is right—to fetch the image only as the user scrolls near. It is a modern convenience, a deferral of effort that feels intelligent and efficient. We have staked our sapling.

But what happens when the stake isn't there? Not because we forgot it, but because the ground itself refused it. This is the reality for a `loading=lazy` image placed within a carousel, a grid implemented with complex JavaScript, or any element that is not part of the natural document flow. The browser's loading viewport is a fixed map, but our components are often fluid, dynamic territories it does not understand.

The image, our unsupported sapling, believes it is safe. It sits there, just off-screen, waiting for its cue. But the cue is based on a calculation that never accounts for its unique, shifted context. The user scrolls, the fruit of the page begins to swell with content, and the image—still unfetched—remains inert. It is only when the component itself is scrolled, or when the main document scrolls far enough to trigger some ancillary threshold, that the browser finally jolts into action. The support arrives late, a stake hammered in after the storm has already bent the stem.

This isn't a failure of the attribute, but a lesson in context. The `loading=lazy` attribute is a wonderful, blunt instrument. It works flawlessly for the predictable, linear layout—the traditional garden row. But our modern pages are less like rows and more like ecosystems, with microclimates and unique topographies. Assuming a one-size-fits-all solution for deferred loading is like using the same stake for a tomato and an orchid; the principle is sound, but the application requires a deeper understanding of the environment.

The craft lies in knowing the soil of your own page. It requires looking beyond the simple attribute to understand the life of the component it lives in. Sometimes, the support must be more intentional—a custom Intersection Observer tied to the carousel's viewport, not the document's. It is the difference between a generic stake and a custom-grown trellis. Both serve the same purpose, but one acknowledges the unique reality of the plant it supports. It is the subtle, often invisible work that separates a page that merely functions from one that truly grows with grace.

Notes & further reading

A few pages I came back to while writing this: