page speed problems

bradley55512
New Member
1 0 0

am I able to move the java scripts from the head to the bottom of the page as its slowing my page down massively

0 Likes
JohnCodes
Shopify Partner
130 10 69

Hi @bradley55512 

You have the option of moving your non-essential scripts to the bottom of your page if you'd like. However, I'd recommend just deferring or asynchronously loading your scripts instead.

This way your non-essential scripts aren't blocking essential page functionality from loading up.

Here's how you can do this:

// Defer loading
<script src="file-name" defer/>

// Async loading
<script src="file-name" async/>

 

Also, depending on the apps you're using, you can conditionally load certain scripts to only be loaded up on certain pages. A good example might be a reviews app that's only needed on product pages. If the reviews app script is in your theme.liquid file then it's likely being loaded up on every page, but that's not necessary.

To optimize this, you'll want to write some code that basically says to only load that particular script on product pages:

{% if template contains 'product' %}
    <script src="reviews-app" />
{% endif %}

 

Beyond that, I'd recommend only having essential apps installed. If there are any apps you don't absolutely need you should uninstall them. They can really start impacting your website's performance if you have an abundant amount.

I hope this helps! Please feel free to reach out to our optimization team at speedboostr.com/contact if you have any more questions.

Developer at SpeedBoostr (Shopify optimization and dev agency).
Try out our Shopify Analyzer (free performance analysis tool).
Check out Order Automator (app that auto tags + fulfills orders, and more automation)
More Apps: Theme Scientist (A/B testing tool), Tip Jar (add a tip button to your store), File Optimizer (optimize CSS, JS, Liquid)