Troubleshooting LiteSpeed Cache Lazy Load Issues: Common Problems and Solutions
Content
LiteSpeed Cache's lazy loading feature is a powerful tool for improving website performance by deferring the loading of off-screen images and iframes. However, users often encounter issues where lazy loading doesn't behave as expected. Based on community reports and solutions, here are the most common lazy load problems and how to resolve them.
1. Lazy Load Not Working or Applying Incorrectly
Problem: Lazy load doesn't activate, or certain elements don't lazy load when they should.
Why it happens: This can occur due to conflicts with other lazy load implementations (from your theme or other plugins), or because LiteSpeed Cache automatically disables lazy loading for logged-in administrators.
Solution:
- Check for conflicts: Disable lazy loading in your theme (e.g., Woodmart) or other plugins, leaving only LiteSpeed Cache's implementation active.
- Test as a visitor: LiteSpeed Cache disables optimization features for logged-in admins. Test your site in an incognito/private browser window to see lazy loading work correctly.
- Verify settings: Ensure "Lazy Load Images" and/or "Lazy Load Iframes" are actually enabled in LiteSpeed Cache > Page Optimization > Media Settings.
2. Excluded Images or Iframes Are Still Lazy Loaded
Problem: You've added exclusions (via classes, URIs, or the Viewport Images setting), but elements are still being lazy loaded.
Why it happens: The VPI (Viewport Images) list may need time to generate. Exclusions might not be correctly formatted, or there could be a conflict with how your page builder outputs code.
Solution:
- Wait for VPI: The VPI service, which automatically handles above-the-fold images, takes time to generate its list of images to exclude from lazy loading.
- Check exclusion syntax: Ensure you are using the correct format in the "Lazy Load Image Excludes" or "Lazy Load Iframe Excludes" fields. You can often use partial URLs or class names.
- Use the metabox: For individual pages/posts, use the "LiteSpeed Cache" metabox in the WordPress editor to add specific image exclusions via the "Viewport Images" setting.
- Consider a filter hook: For advanced users, the
litespeed_media_lazy_img_excludesfilter hook can be used for more dynamic control over exclusions.
3. Layout or Sizing Issues with Lazy Loaded Elements
Problem: YouTube embeds or other iframes don't maintain their correct aspect ratio (e.g., 16:9) when lazy loaded. Images might also appear resized.
Why it happens: LiteSpeed Cache replaces the original element with a placeholder. If this placeholder doesn't have the correct dimensions, it can cause a layout shift when the real element loads.
Solution:
- Disable CSS options: Try disabling "CSS Minify" and "CSS Combine" in Page Optimization > CSS Settings. Purge all caches after making changes.
- Check responsive placeholder: Ensure the "Responsive Placeholder" setting is enabled to help maintain aspect ratios.
- Exclude problematic elements: If the issue persists, consider excluding the specific iframe or image from lazy loading entirely using the methods mentioned above.
4. Sliders or Dynamic Content Not Loading Immediately
Problem: Content in sliders (like Revolution Slider) or tabs only loads after a user scrolls or interacts with the page.
Why it happens: Lazy loading assumes these elements are off-screen and defers their loading, which breaks sliders and tabbed content that need to load immediately.
Solution:
- Exclude JavaScript files: Add the slider's JavaScript to the exclusion lists. Go to Page Optimization > Tuning > JS Exclude / JS Defer Exclude and add a unique identifier for the script (e.g.,
revfor Revolution Slider). - Exclude by class: If the issue is with images inside a slider, try adding the slider's container class to the "Lazy Load Image Excludes" field.
General Troubleshooting Steps
If you encounter any lazy load issue, always follow these steps first:
- Generate a Report Number: This is crucial for debugging. Go to LiteSpeed Cache > Toolbox > Report, click "Send to LiteSpeed", and provide the generated code when seeking help.
- Purge All Caches: After changing any setting, always purge all caches to ensure your changes take effect.
- Test with Defaults: Temporarily disable all other CSS/JS options in Page Optimization to see if a conflict is causing the problem.
Lazy loading is a complex feature that interacts with your theme, other plugins, and specific page content. By methodically testing and using these common solutions, you can resolve most issues and improve your site's loading performance.
Related Support Threads Support
-
Lazy Load Iframes Doesn’t Maintain 16:9 Ratiohttps://wordpress.org/support/topic/lazy-load-iframes-doesnt-maintain-169-ratio/
-
[NSFW] “Lazy Load” ka option kahan milega?https://wordpress.org/support/topic/lazy-load-ka-option-kahan-milega/
-
Lazy loading Spinner size is too bighttps://wordpress.org/support/topic/lazy-loading-spinner-size-is-too-big/
-
Disable lazy load for above the fold imageshttps://wordpress.org/support/topic/disable-lazy-load-for-above-the-fold-images/
-
Viewport images Lazy loadedhttps://wordpress.org/support/topic/viewport-images-lazy-loaded/
-
lazyloaded images never displayhttps://wordpress.org/support/topic/lazyloaded-images-never-display/
-
Lazy Load Images with taghttps://wordpress.org/support/topic/lazy-load-images-with-tag/
-
“Lazy Load Image Excludes” feature is not working on mobilehttps://wordpress.org/support/topic/lazy-load-image-excludes-feature-is-not-working-on-mobile/
-
Issue with Immediate Loading of content on Page Loadhttps://wordpress.org/support/topic/issue-with-immediate-loading-of-content-on-page-load/
-
Image load – grey squarehttps://wordpress.org/support/topic/image-load-grey-square/
-
lazy load media excludeshttps://wordpress.org/support/topic/lazy-load-media-excludes/
-
Exclude Rev Sliderhttps://wordpress.org/support/topic/exclude-rev-slider-2/
-
Preload Featured imageshttps://wordpress.org/support/topic/preload-featured-images/
-
speculative loadinghttps://wordpress.org/support/topic/speculative-loading-2/
-
Preload Featured Image option missinghttps://wordpress.org/support/topic/preload-featured-image-option-missing/
-
Lazy Load Iframe Class Name Excludes ?https://wordpress.org/support/topic/lazy-load-iframe-class-name-excludes/
-
animated lazy load placeholderhttps://wordpress.org/support/topic/animated-lazy-load-placeholder/
-
Lazy load don’t workhttps://wordpress.org/support/topic/lazy-load-dont-work-2/
-
Ifame lazy loading not working anymorehttps://wordpress.org/support/topic/ifame-lazy-loading-not-working-anymore/
-
Best way to exclude dynamic lazy loading on images?https://wordpress.org/support/topic/best-way-to-exclude-dynamic-lazy-loading-on-images/
-
[NSFW] I need a hand with lazy load of images in the Divi Product Images modulehttps://wordpress.org/support/topic/i-need-a-hand-with-lazy-load-of-images-in-the-divi-product-images-module/
-
style placeholder and cache search resultshttps://wordpress.org/support/topic/style-placeholder-and-cache-search-results/
-
Disable lazy loading with full class pathhttps://wordpress.org/support/topic/disable-lazy-loading-with-full-class-path/
-
iframe Lazy Load disabled, but still lazy loadedhttps://wordpress.org/support/topic/iframe-lazy-load-disabled-but-still-lazy-loaded/
-
eatured image still being lazy loaded even when excludedhttps://wordpress.org/support/topic/eatured-image-still-being-lazy-loaded-even-when-excluded/
-
If ON Lazy Load Images setting we see data-no-optimizehttps://wordpress.org/support/topic/if-on-lazy-load-images-setting-we-see-data-no-optimize/
-
How can I add a GIF in a basic image placeholder?https://wordpress.org/support/topic/how-can-i-add-a-gif-in-a-basic-image-placeholder/
-
Filter like “wp_omit_loading_attr_threshold”https://wordpress.org/support/topic/filter-like-wp_omit_loading_attr_threshold/
-
Preload console warningshttps://wordpress.org/support/topic/preload-console-warnings/
-
Exclude Background Imageshttps://wordpress.org/support/topic/exclude-background-images/
-
LS resizing YT video when site loadshttps://wordpress.org/support/topic/ls-resizing-yt-video-when-site-loads/