Hi! Our pagespeed insight scores are not looking so good… A significant source of the errors is around the Main Thread work. How do you optimize this? If the theme is heavy by default, will it always be like this or can we still edit something in the liquid to fix this issue?
Topic summary
A user is struggling with poor PageSpeed Insight scores, primarily due to excessive main thread work, and questions whether their custom theme can be optimized or if it’s inherently problematic.
Primary causes identified:
- Heavy or blocking JavaScript, mainly from app scripts rather than Shopify core or Liquid code
- Potentially large DOM size
Recommended solutions:
- Review and remove unused apps: Disable unnecessary app embeds via Theme Editor
- Defer JavaScript loading: Use
deferorasyncattributes on script tags - Implement lazy loading: Initialize features like sliders and reviews only when visible
- Reduce DOM size: Use pagination and avoid unnecessary JSON output in Liquid (requires manual work, no app solution)
- Optimize CSS: Inline critical CSS and defer non-essential styles
- Consider theme alternatives: Dawn (free) or Booster (paid) are suggested as faster options
Status: The user is now reviewing their apps to identify optimization opportunities. The discussion confirms that significant improvements are possible even with heavy themes through manual code adjustments.
High main-thread work usually comes from too much or blocking JavaScript. Even if the theme is “heavy,” you can still improve it quite a lot:
Quick fixes:
- Review app scripts: Disable or remove unused app embeds (Theme Editor → App embeds).
- Defer JS: Load all scripts with
deferorasync, for example:
-
Lazy load features: Only initialize sliders, reviews, or chat when they’re visible.
-
Reduce DOM size: Use pagination and avoid outputting unnecessary JSON in Liquid.
-
Optimize CSS: Inline critical CSS, load the rest later.
Most of the issue comes from app scripts, not the Shopify core or Liquid. With a few tweaks, you can cut main-thread time dramatically.
Would you like us to take a quick look at your theme setup and show you exactly where to optimize it?
Best regards,
Rafael from Muthwerk
E-Commerce Solutions & Shopify Optimization
Thank you for responding! Would reducing the DOM size require another app or can we do this without an extra app?
Hi,
Eli here from TinyIMG. No app can reduce your DOM size automatically - that has to be done manually.
I agree with Muthwerk: unless your DOM is extremely large, it’s rarely the real issue. The main cause of slow performance is usually heavy scripts from apps, the theme or other tools.
If possible, try switching to a faster theme. Dawn (free) or Booster (paid, but excellent) are both great options.
@shopifyuser13h nope no more apps.
Its better you do it manually. If you want we can do it for you😊
Best regards Rafael
Thank you for your inputs! Yes, currently trying to look at our apps now.
Thank you for your insights! We will try doing this on our end.
