Difference with Iframe Lazy Loading

Created on 15 July 2025, 15 days ago

Hi and thanks for your contribution!

It would be nice to explain on the project page how it differs from the existing Iframe Lazy Loading module: https://www.drupal.org/project/iframe_lazy_loading

Thank you!

📌 Task
Status

Active

Version

1.1

Component

Documentation

Created by

🇫🇷France GaëlG Lille, France

Live updates comments and jobs are added and updated live.
  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

Sign in to follow issues

Comments & Activities

  • Issue created by @GaëlG
  • 🇨🇴Colombia andresalvarez Bogota

    Hi gaëlg,
    Thank you for reaching out and for your kind words about the contribution!
    I appreciate you pointing out the existing Iframe Lazy Loading module. After reviewing both implementations, I can explain the key differences between our approaches:
    Technical Differences:

    Implementation Strategy: Your module uses DOM manipulation with Html::load() and Html::serialize(), while mine uses regex-based pattern matching with preg_replace(). This makes my implementation lighter and potentially faster for large content blocks.

    Scope Coverage: My module implements a broader approach by using hook_element_info_alter() to process all render elements at the system level, plus field preprocessing. Your module focuses specifically on text filters and iframe-specific hooks.

    Performance Considerations: Your module processes the entire DOM tree for each filtered text, while mine uses targeted regex patterns that only process content containing iframes.

    Hook Coverage: Your module excellently handles specific use cases like the iframe module and video_embed_field module through targeted preprocess hooks. Mine takes a more universal approach that should catch iframes from any source.

    Complementary Approaches:
    Both modules solve the same problem but with different philosophies - yours is more targeted and precise, while mine aims for broader coverage with lighter processing. Depending on the site's needs, users might prefer one approach over the other.
    I'll update the project page to clearly explain these differences so users can make an informed choice based on their specific requirements.
    Thanks again for the feedback and for maintaining such a solid alternative!

Production build 0.71.5 2024