Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2010
    Posts
    362
    Plugin Contributions
    0

    Default How can I speed up this page?

    Google's Page Speed analysis tool points out that I have several "blocking" javascript files that would be best loaded after the page loads to improve the speed.

    They have a small script they suggest inserting in the head of the page to do this.

    However, when I look at the html_header.php file in the /common directory, I see several scripts in place for calling all JS files from various directories.

    I'm wondering if anyone here has experience and/or code examples that would allow me to load the javascript at the end of the page loading process, rather than the beginning?

    I can post the Google Javascript here, if that would helpful and/or if it's allowed.

    Thanks,

    John

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Loading Javascript files at end of page

    Have you assessed how much the "blocking" is actually impacting your site? Or are you just taking Google's automated server's generic report's word for it?

    What's the URL?
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Dec 2010
    Posts
    362
    Plugin Contributions
    0

    Default Re: Loading Javascript files at end of page

    What - not trust Google? ;)

    No, I haven't explored it any deeper than that. Google seemed to think it was significant and I'm not sure how to measure what effect the JS files have. But I'm certainly open to suggestions.

    The url I tested was:
    http://quinceandco.com/store/index.p...&products_id=1

  4. #4
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Loading Javascript files at end of page

    You're getting an error on your page:

    Failed to load resource: the server responded with a status of 403 (Forbidden)http://quinceandco.com/store/include...jax-loader.gif
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Loading Javascript files at end of page

    And ironically, the slowest-loading resource on that page is your Google Analytics code ... which by the way you're loading twice on the page for no apparent reason.
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Dec 2010
    Posts
    362
    Plugin Contributions
    0

    Default Re: Loading Javascript files at end of page

    Hmmm, I'll check into the GA code.

    Do you have any idea what would be calling the ajax-loader.gif file? I followed the path you gave me and there is no img directory, so clearly something is missing. I'm thinking if I can find what plugin or component is calling for that, I could at least reload the directory and file.

  7. #7
    Join Date
    Dec 2010
    Posts
    362
    Plugin Contributions
    0

    Default Re: Loading Javascript files at end of page

    OK -- I found what was calling it using the developer toolkit and deleted it for now. Question -- what tool did you use to find that specific error? I probably need to go through this site using some tools like that to find out what else is generating errors. Thanks,

    John

  8. #8
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Loading Javascript files at end of page

    I just loaded your site in Google Chrome and used its built-in Developer Tools.
    The Console showed the image error.
    The Network tab shows the waterfall of how long each element takes to load on the page.
    The Elements tab shows the names of all the assets being loaded, and mentions the ga.js file twice.
    And the basic View Source shows where you're loading the ga.js file twice in the raw HTML being sent to the browser.

    If you don't have Chrome installed, you can do the same with Firebug in Firefox. I believe Ajeh suggested that in your other post that you opened last week on the same subject.
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Dec 2010
    Posts
    362
    Plugin Contributions
    0

    Default Re: Loading Javascript files at end of page

    Ah yes -- thank you.

    John

 

 

Similar Threads

  1. How can I speed up my site?
    By boby in forum General Questions
    Replies: 1
    Last Post: 30 Dec 2014, 06:19 AM
  2. how to speed up index page (main page)? (GoDaddy is slow)
    By 377704497 in forum Basic Configuration
    Replies: 22
    Last Post: 19 Apr 2012, 08:32 AM
  3. how is this speed and can this be improved?
    By raj3396 in forum General Questions
    Replies: 1
    Last Post: 12 Apr 2012, 11:07 AM
  4. How can I remove the H1 header on this page... ?
    By helexia23 in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 29 Mar 2010, 11:21 AM
  5. Is there any way to speed up this page load?
    By Stuff4Toys in forum General Questions
    Replies: 1
    Last Post: 17 Jun 2008, 04:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg