Home Blog Boosting Site Speed: Lazy-Loading Images and Videos in Drupal
Back to Blog
Frontend

Boosting Site Speed: Lazy-Loading Images and Videos in Drupal

acretph_jam
Jamaica Angely Mañus
Software Developer
October 3, 2025
Blog Image

Speed is one of the most important factors in how users experience a website. A slow site can frustrate visitors and lower search rankings. One simple way to make your Drupal website faster is by using lazy-loading, a method that delays loading media until it’s actually needed.

What Lazy-Loading Does

Normally, when a webpage loads, all its images and videos load right away — even those far below the visible screen. Lazy-loading changes that behavior. With this feature, media files are loaded only as the visitor scrolls to them. The result is a quicker page load, reduced data usage, and smoother browsing, especially for mobile users or media-heavy pages.

Built-in Lazy-Loading in Drupal

Starting with Drupal 9.1, lazy-loading is part of the core system. Whenever an image is added through the text editor, media library, or an image field, Drupal automatically includes the loading="lazy" attribute in the HTML code. This small addition instructs browsers to hold off on loading the image until it’s almost visible on the screen.

If your site is running an older Drupal version, or if you’d like additional control, there are contributed modules that enhance lazy-loading:

  • Blazy – Supports both images and videos, including background and responsive images. It integrates well with the Media module and Views.
  • Image Lazyloader – A lightweight option that adds lazy-loading behavior to image fields throughout your website.

Setting Up Lazy-Loading with Blazy

  1. Install and enable the Blazy module.
  2. Go to Configuration → Media → Blazy settings to fine-tune options.
  3. In your content type’s display settings, change the image or video field formatter to Blazy.
  4. Clear caches and view a page — images and videos should now appear only when they come into view.

Why Lazy-Loading Videos Helps

Videos often load heavy scripts and external players that slow down performance. Lazy-loading replaces these with lightweight preview images until users click to play or scroll near them. This approach greatly improves site responsiveness and lowers page weight.

Final Tips

  • Always compress and resize images before uploading.
  • Exclude important hero or banner images from lazy-loading.
  • Use tools like Google Lighthouse to test improvements.

Adding lazy-loading to your Drupal site is a quick, reliable way to create faster pages and a smoother user experience. You should try!

Tags:
Frontend
acretph_jam
Jamaica Angely Mañus
Software Developer
I’m a Junior Web Developer who has been working professionally since January 2021, with most of my experience focused on Drupal development and website-related tasks. Throughout the past few years, I’ve helped build, maintain, and improve Drupal websites by handling updates, page improvements, feature adjustments, and general troubleshooting to support project needs. I work mostly with Drupal-related tasks. I enjoy turning requirements into working solutions and making sure the output looks clean, works smoothly, and stays maintainable over time. I also appreciate the balance between design and functionality — making sure the website is not only working correctly but also user-friendly. Working in the company for several years has been one of the most valuable parts of my journey. It wasn’t always easy — the tasks and deadlines could be challenging — but it was also fun and fulfilling because I learned a lot from real projects. Looking back, I can confidently say I’ve grown a lot as a developer, gained more confidence in problem-solving, and learned how to adapt quickly in a fast-paced working environment.

Table of Contents

AcretPhilippines Inc.
Bringing Japanese software development excellence to the Philippine market since 2019.

Acret Philippines Inc.

14th Floor Latitude Corporate Center

Cebu Business Park

Lahug, Cebu City

TEL: 032-344-3847

09:00 AM - 06:00 PM (PHT)

Head Office Acret Inc.

〒650-0011

601 Kenso Building, 2-13-3 Shimoyamate-dori

Chuo-ku Kobe-shi, Hyogo, Japan

TEL:+81 78-599-8511

10:00-17:00 JPT

© 2025 Acret Philippines Inc. All rights reserved.