How to clear unused code ?

Shopify Partner
187 2 31

Hi @PhilHagspiel ,

No worries at all.

Just had a quick look at your site. There are no apps significantly slowing down your initial page load. It's mostly coming from your theme.

There's some apps that make requests after the main page-loads that are showing up in the Google report, but they're modestly sized.

To be honest, your site loads very fast for me. Product page feels like it loads in about a quarter of a second.
As I understand it, Shopify speed score is just an integrated, branded version of Google Lighthouse.
Google lighthouse bases it's tests as if the user was on a 'slow 4g internet connection' with a mediocre 'android' device (for mobile), so maybe that sheds some light on why your score is lower than we'd expect.

Not that helpful I'm afraid.

Cheers,

Oli

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

0 Likes
New Member
1 0 0

Hi Oli,

I've noticed that you're helping a lot of people with their Shopify speeds. I'm struggling with my store speed as well - Lighthouse is showing a score of 31 which seems extremely low. Apparently it's due to some unused JS "cdn.shopify.com/vendor...", but I have no idea what to do with it. Any chance you could tell me what to do to optimise it?

The store address is nutreally.co

Cheers!

0 Likes
Shopify Partner
7 0 1

Hey Oli, 

would love to hear your opinion on my store. I think there is a lot of work on this one: 

https://malujdiamentami.com/

1. I was wondering, how can I start optimizing the liquid files on my back-up theme and then test it against Lighthouse after some time? Can it be only done on the production theme? 
2. Would you know a way to display/render apps, like messenger app/loyalty app only on specific pages, not on all pages? Would that increase the page speed load?  
3. Would you also know if this lazy-loading is fetching the minified image on the initial page load even if the user does not see the image? If yes, then do you know any resources where I could try and load the image only if the user is close to it? 

Any further referral to helpful documentation is much appreciated. 

Dom 

0 Likes
Shopify Partner
187 2 31

Hi @slize,

Yep sure, so, the 'cdn.shopify' is a request to Shopify's servers. It's probably coming from your theme. Which theme you use makes a big difference to page speed. I can't see any obvious ways to improve your site speed, but I'm really not an expert on site-speed.

I've included a little chart which lists the 'third-party' code from the report by company name:

 

Third-PartyTransfer SizeMain-Thread Blocking Time

Shopify
1,586 KiB
1,482 ms
Facebook
115 KiB
55 ms
Google Tag Manager
76 KiB
11 ms
Google Analytics
37 KiB
5 ms
Google/Doubleclick Ads
18 KiB
0 ms
Other Google APIs/SDKs
2 KiB
0 ms

 

Cheers,

Oli

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

0 Likes
Shopify Partner
187 2 31

Hi @Sweetsensej ,

I'm really not an expert on page-speed, but I've included my 2 cents below. Hopefully, it's helpful in some way.

1. As I understand it you should be able to run a new lighthouse test straight after making a change. It seems to create a new test each time, I'm guessing it runs as if there's no cached files either.
Whether this can only be done on the production theme is good question. I'd be interested to hear an answer to this, if you end up testing this way.

2. It really depends on how the app works. If the app is configured through Shopify script tags, then it will have the chance to load on most pages of your theme and I think this is pretty hard to configure as a store owner. We have some logic within our app, which means it only gets a chance to load on product pages, but I don't think all apps will be like this.
If the apps are just being called from the <head> section of your theme.liquid, or from within a specific page template, then that would be pretty easy to tweak. 
This would increase page speed in reality, but I'm not sure if Lighthouse discriminates that way in it's final speed score.

3. My understanding of lazy loading is exactly what you describe. The main image only loads when it's about to come into the view port panel of the user's screen.

Good luck,

Oli

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

New Member
1 0 0

HI Im having the smae issue. my site is www.sportsintegrity.com thanks in advance for any help in removing unused code etc. site is has a score of 11

0 Likes
Shopify Partner
187 2 31

Hi @sportsintegrity ,

There's quite a bit of low hanging fruit here. Maybe start by implementing 'lazy loading', which Google says could save up to 2.7 seconds. There are some instructions on how to do this earlier in the thread.

There's quite a few requests which directly effect your page speed here:

URLTransfer SizePotential Savings

…css/bootstrap.min.css
(maxcdn.bootstrapcdn.com)
38.8 KiB
1,650 ms
…css/bootstrap-theme.min.css
(maxcdn.bootstrapcdn.com)
5.5 KiB
150 ms
34.5 KiB
1,770 ms
2.8 KiB
150 ms
/css?family=…
(fonts.googleapis.com)
5.1 KiB
920 ms
…css/all.css
(use.fontawesome.com)
25.4 KiB
1,400 ms
/css?family=Lato:400,700
(fonts.googleapis.com)
1.2 KiB
150 ms
94.9 KiB
1,800 ms
36.5 KiB
600 ms
…css/font-awesome.min.css
(cdnjs.cloudflare.com)
7.6 KiB
910 ms
…js/bootstrap.min.js
(maxcdn.bootstrapcdn.com)
19.3 KiB
450 ms
…css/font-awesome.min.css
(maxcdn.bootstrapcdn.com)
13.2 KiB
300 ms
/aio_stats_lib_v1.min.js?v=1.0
(staticxx.s3.amazonaws.com)
0.4 KiB
890 ms

 

There's a request for your theme's stylesheet, as well as the Bootstrap stylesheet (a front-end framework from Twitter), there are also multiple font API requests. Maybe have a look at the theme.liquid file in your store's theme folder and make sure you recognise all of the names in the <head> section. It's probably going to be a bit of trial and error finding where all these requests come from. I also think about 50% of the requests are coming from your theme (so can't be really removed).

Good luck,

Oli

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

0 Likes
New Member
5 0 0

Hello

 

Can u check my site speed, please?? And help me remove all the trash codes? Thanks

 

www.mjfitness-store.com

0 Likes
Shopify Partner
187 2 31

Hi @mjfitness ,

You have some images not using 'lazy loading', check back through this thread for instructions on implementing this.

The rest doesn't look too bad, only your stylesheet is listed in 'render-blocking resources', so no real work to do there.

The 'remove unused Javascript' section of Google's report contains the below requests. This isn't really as important as the 'render-blocking resources', but you can look into them if you would really like to improve your score

 
 Show 3rd-party resources (9)

URLTransfer SizePotential Savings

355.3 KiB
205.1 KiB
165 KiB
93.6 KiB
137 KiB
61.1 KiB
80.1 KiB
49.8 KiB
139.8 KiB
48.2 KiB
51.4 KiB
36.3 KiB
96.9 KiB
34.1 KiB
…1.10.2/jquery.min.js
(ajax.googleapis.com)
34.8 KiB
22.9 KiB
54.7 KiB
20.1 KiB

 

Cheers,

Oli

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

0 Likes
New Member
5 0 0

Thank you for your response. I am not a programmer to know how to do them. Can u pls help?

0 Likes