Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Site speed and JS loading

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-21-2015, 06:54 AM
 
MAPerformance Admin MAPerformance Admin is offline
 

Advanced Member
  
Join Date: Jun 2013
Posts: 44
 

Default Site speed and JS loading

So we've been having some serious problems with site speed in Google Analytics, and their top suggestions to fix this are to remove render blocking resources.

The majority if their suggested fixes involve jQueryUI calls, which appear in /skin/common_files/jquery_ui.tpl
Code:
{load_defer file="http://code.jquery.com/jquery-1.4.2.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.core.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.widget.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.position.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.mouse.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.button.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.dialog.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.resizable.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.draggable.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.tabs.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.datepicker.min.js" type="js"} {load_defer file="lib/jqueryui/jquery.ui.effects.min.js" type="js"}

which itself is loaded in /skin/common_files/meta.tpl
Code:
{include file="jquery_ui.tpl"}

Along with other resources mentioned by Google
Code:
{load_defer file="js/ajax.js" type="js"} {load_defer file="js/popup_open.js" type="js"} {load_defer file="lib/jquery.blockUI.js" type="js"} {load_defer file="lib/jquery.blockUI.defaults.js" type="js"}

I was under the impression that the whole load_defer thing was supposed to "fix" this, but apparently it doesn't. What do we need to do to prevent these items from slowing our site down without breaking something?
__________________
X-cart 4.4.3 Gold
Modern Automotive Performance
Reply With Quote
  #2  
Old 01-21-2015, 12:44 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Site speed and JS loading

The javascript is deferred twice in the code, once in the header, once in the footer. The majority of javascript is placed in the header, and even when deferred loads in the head before the site content. Much of the javascript can be moved to the footer but some of it is necessary in the header because it's used in the content of the page. Trick is to either:

a) determine what is and isn't needed in the head and move it to the footer

2) determine what is needed in the content of your site and recode it so all javascript can be moved to the footer

Neither one is an easy task.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:10 PM.

   

 
X-Cart forums © 2001-2020