-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend lazy-loading exclusion rules to background lazy-loading #843
Comments
Thank you for creating this issue. Our product team will evaluate the impact of this issue compared to other open bugs and upcoming features and assign a priority level to the bug report. Our developers prioritize the highest-priority issues first, so we cannot provide a specific timeline for resolution at this time. In the meantime, if you want to exclude some background images from lazy loading process than you can achieve this by using a manual approach. To do so, you must edit the page and add the CSS class "optml-bg-lazyloaded" to the background image. If you have any additional information that may assist with prioritization or resolution, feel free to reply to this thread. |
hi @brian-brightfire what kind of exclusions rules are you looking to have? Per filename? Additional classes that the container has? I'm curious what you are trying to solve with this, too. Are you looking to avoid BG lazyload on hero images in general? |
@selul - the exclusion rules which currently exist for normal image tags would be more than suitable. We would likely leverage filename words (based on what is currently available for normal images). But in general, yes - We are looking for the ability to lazy-load all background images, and exclude the LCP (hero) image in general, as this goes against best practices from a performance standpoint. We also understand that currently we would need to take a manual approach, but this is not going to be attainable for us as we use Optimole and WP at scale on large multisite installs with over 1000 sites on each install. We do have a development team, but in general our design team uses the build tools, so we would like to provide a method non-developers can easily leverage. |
An alternative for this now would be adding a class to the container that the hero background image is using add the :not CSS selector in the Background CSS selectors area. For instance, if all the elements that have BG images have the class Let me know if this fixes your issue for now, I will think about how the exclusion can be extended too or how this can be done automatically to avoid BG lazyload on hero images automatically. |
Thanks, @selul - I tried that out. Unfortunately, this didn't seem to work for us, as we are applying this to an Elementor Container Background, and the actual background is applied to the child .elementor-background-overlay div. To be clear, what we have is markup like:
Exclusion class is added to the div with Then in the |
What problem does this address?
We are looking for the ability to activate lazy-loading for background images, but with additional support for EXCLUSION rules, similar to what you have for regular tag lazy-loading. This would help us continue to leverage lazy-loading of backgrounds, while allowing pointed exceptions for LCP images.
What is your proposed solution?
Would like to see an extension to lazy-loading exclusions rules which will apply to background lazy-loading as well as normal tags.
Will this feature require documentation? (Optional)
None
The text was updated successfully, but these errors were encountered: