Announcement

Collapse
No announcement yet.

External script file - which code?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    External script file - which code?

    Hi Guys

    I'm looking to optimise my website's pages to improve page load times and I understand removing all script from the page (and onto an external file) will help?!?!?

    I'm not sure exactly which scripts I can or cant remove? Can anyone have a look at the www.kjbeckett.com homepage and a sample catalog page such as http://www.kjbeckett.com/acatalog/cufflinks_p4.html and point me in the correct direction?

    Thanks

    Paul
    KJ Beckett
    Men's Clothing & Accessories
    Cufflinks, Underwear, Ties, Grooming Products
    Bath, England
    Fast delivery to UK, USA and worldwide.
    Men's Fashion Blog

    #2
    Whose told you that? If a file, say 15kb is loaded internally or externally referenced, it is still 15kb and i would expect very little if any difference.

    Aside from image optimisation, the yahoo sections tree is often one replaced by top level sections variable, however that is a replace and not a move.

    Comment


      #3
      Oh, so no "page speed" help in removing the script at all?

      I was also told it has SEO benefit?

      Paul
      KJ Beckett
      Men's Clothing & Accessories
      Cufflinks, Underwear, Ties, Grooming Products
      Bath, England
      Fast delivery to UK, USA and worldwide.
      Men's Fashion Blog

      Comment


        #4
        Originally posted by paulbeckett
        I was also told it has SEO benefit?
        Not sure about that, I guess it depends on the scripts but I can't see any of yours causing any major SEO issues.

        Your pages did seem slow though, nothing major I could see so is it possible it is a server issue as opposed to a page issue?
        Cheers

        David
        Located in Edinburgh UK

        http://twitter.com/mcfinster

        Comment


          #5
          If a file can be used across a number of different pages, it is wise for it to be an external file and externally linked to. This way there is one master file and if you ever need to change things, you amend one file and all pages will see the new file. Whereas with the same items included into each file, it is inefficient and any changes would need to be made on each instant of it - that would be a performance reduction undoubtedly.

          Full xhtml will have css as external files and all javascript externally for example, so that the actual web page itself has just the html code. The interaction and styling is then provided via external files, which if used globally only need to be loaded once.

          On any single page, whether the file is external or internal linked, i can see no performance gain, only better housekeeping and maintenance.

          Quick loading pages in as efficient manner as possible is certainly good for SEO, this is not in the balance on whether you internally or externally link, it is more the efficiency, architecture and common sense that counts.

          CSS is probably your prime example, when someone first visits your home page, the global css file is downloaded and this will style every other page as they are accessed. Counter that against having the CSS specific styles within each page and you have both a maintenance nightmare and an inefficient system.

          Comment


            #6
            but I can't see any of yours causing any major SEO issues
            . Have to disagree with you - there is a huge amount of java in the pages which will almost certainly have an effect on SEO.

            Comment


              #7
              mmm, you learn something new everyday. Is it any partiuclar script or just the number that would make a difference?
              Cheers

              David
              Located in Edinburgh UK

              http://twitter.com/mcfinster

              Comment


                #8
                Thanks guys.

                Your pages did seem slow though, nothing major I could see so is it possible it is a server issue as opposed to a page issue?
                Im actually moving away from Claranet shared server (boo hiss) to a dedicated server (Pinbrook) today - actually during this post and threads. You probably hit the superslow Claranet - they really are bad and expensive to boot.

                If you hit my site from c. 6pm onwards you should be amazed by the loadspeeds (I am). No time for my customers to daydream about competitors anymore!!!

                there is a huge amount of java in the pages which will almost certainly have an effect on SEO.
                Thats what I thought. I need to get this java into a central point? Are there any pitfalls in doing this?

                Paul
                KJ Beckett
                Men's Clothing & Accessories
                Cufflinks, Underwear, Ties, Grooming Products
                Bath, England
                Fast delivery to UK, USA and worldwide.
                Men's Fashion Blog

                Comment


                  #9
                  Paul,

                  Seems hugely better for load times now. Lets hope it makes a difference to your sales!!!
                  Cheers

                  David
                  Located in Edinburgh UK

                  http://twitter.com/mcfinster

                  Comment


                    #10
                    So sould I look to move anything that begins with <script language=JavaScript> and ends with </script>?

                    Do I create a file like javafiles.js and put everything in that?

                    How do I tell the page to refer to everything in the file?

                    Paul
                    KJ Beckett
                    Men's Clothing & Accessories
                    Cufflinks, Underwear, Ties, Grooming Products
                    Bath, England
                    Fast delivery to UK, USA and worldwide.
                    Men's Fashion Blog

                    Comment


                      #11
                      Paul

                      What you should do is such an open question. If you search Google on a number of search terms, i'm sure you will see that the top sites are as plastered with JS as any others. IMO although it may have a slight effect, there are probably 957 other things you should worry about before worrying about this. If you want to improve your site, work on the things that will make a considerable difference, not things that (if they change anything) make a very small difference.

                      In the head section of your pages you will see how JS is referenced, just copy this format if this is something you want to do.

                      Comment


                        #12
                        Ok thanks, I understand. I'm working on the assumption that even if this change helps me move rom position 67 to 66 then it would be worth it.

                        I see I already reference external files:

                        <SCRIPT LANGUAGE="JavaScript" SRC="acatalog/actiniccore.js" TYPE="text/javascript"></SCRIPT>
                        Is there any downside to putting the script in a central file?

                        Also should I have one file or mutliple files off page (I currently have multipe script files - norpricesupport.js, acatalog/actiniccore.js etc? What would the difference/impact be of having one?
                        KJ Beckett
                        Men's Clothing & Accessories
                        Cufflinks, Underwear, Ties, Grooming Products
                        Bath, England
                        Fast delivery to UK, USA and worldwide.
                        Men's Fashion Blog

                        Comment


                          #13
                          If the scripts are used on many pages then it makes sense to place that code into an externally referenced js file. (or add it to the end of actiniccore.js) This means that the js code is only downloaded once and will reduce some bulk from your pages. I think that removing any code html, js or whatever and leaving just the core text in the page is a good thing and surely helps the SEs. Prinicipally what css does for formatting.

                          Comment


                            #14
                            IMO although it may have a slight effect, there are probably 957 other things you should worry about before worrying about this
                            I would definately not agree with this. While many sites - including some of mine have java in the header you have an excessive ammount.

                            SE spiders will only look so far down a page so if the head of your page is full of java they will get bored and leave never getting to your page content. Getting rid of this will put your important content at the top of the page where the spiders can get to it and allow google etc to rank your page.

                            Comment


                              #15
                              Paul

                              Matt Cutts in a recent article mentioned that ideally all css and javascript should be external (as per xhtml) ideally, however it is not a show stopper as Google has improved it's reading of javascript a hell of a lot and continues to do so.

                              So it is a factor, how big is anyones guess and it should be done at some stage. I would suggest there are far more important things to cross off the "to-do" list first. If anyone firmly believed this could have a big impact on rankings, surely it would be plain crazy to even have 15 or 20 lines embedded? The "I know this is wrong, but there's not too much" approach.

                              Some top ranking sites have 5 or 10x that amount of javascript, maybe they are there in spite of this, who knows.

                              Comment

                              Working...
                              X