litespeedtech / litespeedtech/lscache_wp
Lazy load Iframe and JS delayed conflict
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 257
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
I enabled Lazy load image and Iframes. Images working as aspected. Iframes also working as aspected. But after enabling JS Delayed feature, iframes getting loaded instantly on interaction without scrolling to viewport.
This is because if we enabled JS delayed, Litespeed adding data-litespeed-src to iframes instead of regular data-src. Additionally, Litespeed JS delayed script include a code document.querySelectorAll(“iframe[data-litespeed-src]”).
so, why Delaying js also affect on iframes? Even iframe lazy load and js lazy load is two different approach? Please forward this to developers.
Make sure to always load iframes when it enters viewport, even JS delayed enabled.
If this issue not fixed ASAP, then many of Litespeed Cache Plugin users with JS delayed and lazy load iframes enabled will loss Video Content visibility on Search engine. Because without JS delayed enabled, it uses IntersectionObserver for iframe, so Search engine bot can easily crawl iframes videos like YouTube. But currently it Requires Interaction to load the Iframes. Iframes are working like JS DELAYED. Please fix this ASAP.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with iframe lazy loading and JS Delayed enabled, then search the plugin for `data-litespeed-src` and `iframe[data-litespeed-src]`. Trace the interaction between the delayed-JS path and the iframe IntersectionObserver behavior. Done means iframes load when entering the viewport without requiring interaction, while the existing lazy-load behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php, wordpress
- Domain
- performance, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100