I’m trying to optimize mobile Core Web Vitals/PageSpeed on my WooCommerce product pages, and I discovered that XStore appears to preload/render ALL variation gallery images into the initial HTML output.
On variable products with multiple color variations, the page source contains:
all variation gallery thumbnails
all swiper slides
all zoom/photoswipe elements
all srcset image variants
for every variation before the customer selects a variation.
This creates:
very large DOM size
excessive swiper/lightbox initialization
delayed LCP discovery
high mobile INP/TBT
Example:
The product gallery outputs all BLACK / BLUE / RED variation galleries immediately inside the swiper thumbnails container instead of loading only the default/current variation gallery.
Questions:
Is there a setting, filter, or optimization to load ONLY the selected/default variation gallery on initial page load?
Can non-selected variation galleries be loaded dynamically via AJAX after variation selection?
Is there a way to disable/prevent preloading of all variation gallery thumbnails/slides?
Is there a mobile optimization mode to reduce swiper/gallery DOM size?
Is there a recommended way to disable PhotoSwipe/zoom/swiper initialization for non-visible variation images?
I already:
optimized/compressed images
use WebP
use Perfmatters lazy loading exclusions
enabled WooCommerce AJAX variation threshold
But the bottleneck appears to be the initial gallery HTML/DOM generated by XStore itself.
Any recommended filters, hooks, custom snippets, or theme settings would be greatly appreciated.
The current LCP is taking 28 seconds to load
https://pagespeed.web.dev/analysis/https-safedesires-com-product-plunge-lace-babydoll/lfrdh88p6o?form_factor=mobile