Description
When the Lazy Load feature is enabled in Powered Cache (v3.7.x), images are correctly replaced with the inline base64 GIF placeholder (src="data:image/gif;base64...") and assigned the lazy-hidden class.
However, under specific network conditions—specifically when accessing the site via a VPN (freevpn.one from USA) or from regions with higher network latency (e.g., cross-atlantic routing)—the JavaScript execution chain responsible for swapping the data-lazy-src attribute into the src attribute fails to trigger or complete.
As a result, the images permanently remain as empty boxes (stuck with the lazy-hidden class), even though no console errors are generated by the plugin's script itself. Disabling the Lazy Load feature in Powered Cache settings instantly resolves the problem.
Steps to reproduce
- Enable Lazy Load in Powered Cache settings (Media Optimization).
- Clear all cache levels.
- Access the website using a VPN from a distant location using a clean Incognito browser session.
- Observe that images fail to render, remaining stuck as base64 placeholders.
Suggested investigation / Fix
It seems to be a race condition related to how the lazy load script hooks into the DOM lifecycle (DOMContentLoaded or window.load events). When latency is high, the initialization script seemingly "misses" its execution window or fails to bind scroll/intersection listeners to elements that are already present in the DOM.
Please consider wrapping the lazyload initialization code with a fallback check for document.readyState === 'complete'.
Description
When the Lazy Load feature is enabled in Powered Cache (v3.7.x), images are correctly replaced with the inline base64 GIF placeholder (
src="data:image/gif;base64...") and assigned thelazy-hiddenclass.However, under specific network conditions—specifically when accessing the site via a VPN (freevpn.one from USA) or from regions with higher network latency (e.g., cross-atlantic routing)—the JavaScript execution chain responsible for swapping the
data-lazy-srcattribute into thesrcattribute fails to trigger or complete.As a result, the images permanently remain as empty boxes (stuck with the
lazy-hiddenclass), even though no console errors are generated by the plugin's script itself. Disabling the Lazy Load feature in Powered Cache settings instantly resolves the problem.Steps to reproduce
Suggested investigation / Fix
It seems to be a race condition related to how the lazy load script hooks into the DOM lifecycle (
DOMContentLoadedorwindow.loadevents). When latency is high, the initialization script seemingly "misses" its execution window or fails to bind scroll/intersection listeners to elements that are already present in the DOM.Please consider wrapping the lazyload initialization code with a fallback check for
document.readyState === 'complete'.