Reducing Bandwidth: Hosting jQuery files externally


NOTE: Any theme added after 6/8/2015 will automatically pull the jQuery files from the Google CDN servers.

Jquery is a library for Javascript, making front end development easier for end users. However the Jquery and Jquery.ui files can start to take up a lot bandwidth. Recently we added in functionality so that you could choose where to pull the Jquery files from. Most of our customers use the Google CDN (a free service that will let you link these files from the Google servers) to host these, but the methods should be the same no matter where you are hosting the files.

You will want to log into the admin panel, and go to Themes > Edit Theme > Global Theme Settings. Here you will find a couple options: jQuery File Path and jQueryUI JS File Path.

jQuery File Path default:

/store/admin/inc/vendor/jquery.js

can change to

//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js

 

jQueryUI File Path Default:

/store/inc/jquery.ui.js

can change to

//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js

 

jQueryUI Core CSS File Path

/store/inc/style/jquery.ui.core.css

can change to

//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css

Click here for additional CDN links

jQuery Official CDN

JS: //code.jquery.com/ui/1.10.4/jquery-ui.min.js

CSS (single sheet): //code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.min.css 

Cdnjs

CSS (single sheet): //cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/css/jquery-ui.min.css

CSS Core : //cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/css/jquery.ui.core.css

CSS Theme : //cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/css/jquery.ui.theme.css

CSS Tabs : //cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/css/jquery.ui.tabs.css

NOTE: Advanced users may need a different jQuery version. Simply replace the number in the link to the version you need, as it is already hosted on the Google CDN servers. More information can be found here.

After changing the path, make sure to save! After the save, the store should start pulling the files from the external server, helping to reduce bandwidth costs on the storefront.

How helpful was this article?
Number of questions: 0