Skip to main content

Lazy Load Images, Videos, and Iframes

Updated this week

FlyingPress improves performance by lazy loading images, videos, and iframes that appear below the fold. Media in the initial view loads immediately to ensure fast rendering and a smooth user experience.

How it works

  • Our cloud optimizer detects above-the-fold media (images, videos, iframes)

  • These are excluded from lazy loading automatically

  • All other media is marked with loading="lazy" and loaded only as the user scrolls

  • Above-the-fold media is marked with loading="eager" and loaded immediately

Automatic preloading

FlyingPress also preloads key above-the-fold images to further improve Largest Contentful Paint (LCP) by telling the browser to fetch them as early as possible.

Excluding media manually

If you want to exclude specific images, videos, or iframes from lazy loading (even if they’re not above the fold), you can do so by entering a keyword found in the media tag.

✅ Matching is partial and case-insensitive
Regex and wildcards are not supported

FlyingPress checks the full <img>, <video>, or <iframe> tag - including attributes like src, class, alt, etc.

Examples

✅ Image

<img src="/assets/logo.png" alt="Site Logo">

To exclude, enter:

logo
logo.png
/assets/

✅ Video

<video class="hero-video" autoplay muted playsinline>
<source src="/videos/intro.mp4" type="video/mp4">
</video>

To exclude, enter:

hero-video
intro.mp4
/videos/

✅ iFrame

<iframe src="https://www.youtube.com/embed/abc123" class="video-player"></iframe>

To exclude, enter:

youtube.com
abc123
video-player

Best practices

  • Exclude only media that must load immediately (e.g. logos, header videos, above-fold embeds)

  • Use class names, file names, or partial URLs as exclusion keywords

  • Avoid generic terms to prevent over-matching

Did this answer your question?