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
2516 229 678

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 [auto tag, fulfill, connect FBA, daily jobs]
• Co-Creator of Product Automator [suite of features for products / collections]
• Shopify developer for 10+ years, store owner for 7 years
• Blog: Shopify Tips, Guides, and Automation Tactics

View solution in original post

Replies 2 (2)

JoesIdeas
Shopify Partner
2516 229 678

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 [auto tag, fulfill, connect FBA, daily jobs]
• Co-Creator of Product Automator [suite of features for products / collections]
• Shopify developer for 10+ years, store owner for 7 years
• Blog: Shopify Tips, Guides, and Automation Tactics
tim202
Shopify Partner
31 4 3

Thank you for the reply