Hi all,
I’m running a PageSpeed Insights audit on my site (built with Elements) and the “Render-blocking requests” diagnostic flags several framework scripts that seem to load site-wide regardless of whether the corresponding feature is actually used on a given page:
alpine-exit-intent.jsmodal.jsimage-lightbox.jsflatpickr.min.js(date picker)alpine-store-filters.jsgsap.min.js+ScrollTrigger.min.js+gsap-effects.js+effectsTransforms.jssmoothscroll.min.js
Combined, these add up to roughly 5.7 seconds of render-blocking time on mobile (throttled), according to PageSpeed Insights.
My questions:
- Does Elements only load these scripts when the corresponding feature (lightbox, exit-intent popup, date picker, scroll animations, etc.) is actually used somewhere on the page, or are they always included regardless of usage?
- If they’re always included, is there a way to disable specific features site-wide (or per-page) so their scripts aren’t loaded when not needed?
- Is there a built-in option to load these scripts with
deferorasyncinstead of render-blocking in the<head>?
Any guidance on reducing this render-blocking footprint would be appreciated. Happy to share a PageSpeed report or URL if that helps diagnose it.
Thanks!