Re: CDN vs Shopify server | Performance

Solved

Is it better to host Javascript in my theme or use a CDN?

tim202
Shopify Partner
31 4 3

Should I host my own Javascript {{ "javascript.js" | asset_url }} in my theme or is it better to use the javascript library cdn?

Accepted Solution (1)

JoesIdeas
Shopify Partner
2324 211 616

This is an accepted solution.

I would load as many assets as you can in your own theme, that will cut down on the number of different 3rd party resources needed, this way your code loads directly from your site's server (Shopify CDNs).

 

If you want to dive into optimizing 3rd party scripts this is a good article: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-thi...

 

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Figure Out Why You're Not Getting Sales

View solution in original post

Replies 2 (2)

JoesIdeas
Shopify Partner
2324 211 616

This is an accepted solution.

I would load as many assets as you can in your own theme, that will cut down on the number of different 3rd party resources needed, this way your code loads directly from your site's server (Shopify CDNs).

 

If you want to dive into optimizing 3rd party scripts this is a good article: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-thi...

 

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Figure Out Why You're Not Getting Sales
tim202
Shopify Partner
31 4 3

Thank you for the reply