Online store performance and site speed optimization
Hey Shopify Community,
we are running a Shopify Plus store for 2 years now and our main problem is that a lot of functionality only comes with apps or we'd have to custom code them which would take unnecessary resources to do work that already has been done. The main problem with apps is that they inject Javascript into every page, even tho some apps are only needed on specific ones like cart, product, home or content pages.
Therefor we stumbled across a solution from another member @PageFly-Richard (thanks for the hint!) to comment out the {{ content_for_header }} which is definitely a solution, but doesn't let you load specific apps on specific pages.
We spun it further and created rules to strip only specific javascript (apps) on specific pages. The results were satisfying and we decided to release an app doing exactly that. https://apps.shopify.com/pagespeed-javascript
We are happy for any feedback, improvements, bugs you report. It should definitely help stores with a lot of apps installed.
@Marc_Mayr you can load scripts where they needed
ex:
{% if template != "index" %}
{% include 'custom.js' %}
{% endif %}
custom.js will load on every pages except home
{% if template contains 'cart' %}
{% include 'cart.js' %}
{% endif %}
cart.js will load on cart pages only
► Need help with theme customization, speed optimization, fix bugs?
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023